Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage issues - xorg.conf, service autostart #51

Open
AGenchev opened this issue Aug 22, 2022 · 4 comments
Open

usage issues - xorg.conf, service autostart #51

AGenchev opened this issue Aug 22, 2022 · 4 comments

Comments

@AGenchev
Copy link

AGenchev commented Aug 22, 2022

I want to use your script, but I can't get xorg.conf the way you describe in USAGE.md

I have 2 cards, the display is at one of them. Where you connect the display becomes the first GPU in the nvidia-settings panel. It changes it if you plug the display in the other card. nvidia-settings does not create file in /etc/X11/xorg.conf.d.
So no way to ensure coolbits are set properly.
I'm trying to make the file by manual creating 20-nvidia.conf file:

Section "Device"
        # You may change the identifier number to your use case.
        Identifier      "Device0"
        Driver         "nvidia"
        BusID          "PCI:8:0:0"
        BoardName      "NVIDIA GeForce RTX 3090"
        VendorName     "NVIDIA Corporation"
        Option         "Coolbits" "28"
EndSection

Section "Device"
        # You may change the identifier number to your use case.
        Identifier      "Device1"
        Driver         "nvidia"
        BusID          "PCI:9:0:0"
        BoardName      "NVIDIA GeForce RTX 3090"
        VendorName     "NVIDIA Corporation"
        Option         "Coolbits" "28"
EndSection

This resulted in blank screen and in the log of Xorg I see "Option Coolbits not used".
The BusIDs are taken from the output of lspci

@AGenchev
Copy link
Author

AGenchev commented Aug 22, 2022

This https://bbs.archlinux.org/viewtopic.php?id=257891 got me fixed:

Section "Device"
        # You may change the identifier number to your use case.
        Identifier      "Device0"
        Driver         "nvidia"
        BusID          "PCI:8:0:0"  
        BoardName      "NVIDIA GeForce RTX 3090"
        VendorName     "NVIDIA Corporation"
        Option         "Coolbits" "4"
EndSection

Section "Device"
        # You may change the identifier number to your use case.
        Identifier      "Device1"
        Driver         "nvidia"
        BusID          "PCI:9:0:0"  
        BoardName      "NVIDIA GeForce RTX 3090"
        VendorName     "NVIDIA Corporation"
        Option         "Coolbits" "4"
EndSection

# a layout combining the actual and virtual monitors
Section "ServerLayout"  
    Identifier    "Layout0"     
#   Our real monitor, plugged in the first GPU - Device0
    Screen 0      "Screen0" 0 0     
#   Our virtual/fake monitor
    Screen 1      "Screen1"     
EndSection

Section "Screen"
# A screen, for the real Monitor0 plugged in the first GPU - Device0
    Identifier     "Screen0"
#card0
    Device         "Device0"
# actual monitor
    Monitor        "Monitor0"
    DefaultDepth 24
    SubSection     "Display"
       Depth 24
    EndSubSection
EndSection

Section "Screen"
# A screen, for the fake monitor, plugged in the second GPU - Device1
    Identifier     "Screen1"
# discrete GPU nvidia
    Device         "Device1"
# virtual monitor
    Monitor        "Monitor1"
    DefaultDepth 24
    SubSection     "Display"
       Depth 24
    EndSubSection
EndSection

# These are 2 sections for the real and the fake/virtual monitor, we can omit most settings for now
Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    Option         "DPMS"
EndSection

They describe that if one of the cards does not have plugged in monitor, we need to define a fake one (Monitor1 is fake), so I modified my file accordingly. Now nfancurve works but only manually, the service dies. The service unit has this code:

[Unit]
Description=Nfancurve service
After=graphical-session.target
Requires=graphical-session.target

[Service]
ExecStart=/home/user/nfancurve/temp.sh -c /home/user/nfancurve/config
KillSignal=SIGINT
Restart=always
RestartSec=16

[Install]
WantedBy=graphical-session.target

I am not sure that /etc/systemd/user/ is the best place for it though. One related systemd article suggests that the right place is
~/.config/systemd/user/ though the service likely fails for other reasons.

@AGenchev AGenchev changed the title xorg.conf - how to usage issues - xorg.conf, service autostart Aug 22, 2022
@AGenchev
Copy link
Author

If I excecute manually:

systemctl --user daemon-reload
systemctl --user enable nfancurve.service
systemctl --user start nfancurve.service

it starts.

@nan0s7
Copy link
Owner

nan0s7 commented Jan 7, 2023

Hey, sorry for not seeing this!

Glad you were able to figure out the xconf issue.

However, what do you mean by "the service dies manually"?

I'll have to add notes to my usage file reflecting the addition of monitors that aren't turned on. Thank you for that.

@AGenchev
Copy link
Author

AGenchev commented Jan 14, 2023

I performed a search in this page by "the service dies manually" and found only one match - in your question (after I post this there will be 2 matches).
But the service really dies and does not get restarted by systemd, which is weird.
I guess it dies because at the beginning, the user is not logged in yet. So when it tries to call some nvidia tool, the tool fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants