Ubuntu 控制多个 Nvidia GPU 上的风扇速度

Ubuntu 控制多个 Nvidia GPU 上的风扇速度

我有 3x Nvidia gpus,Ubuntu 18.04。

我希望能够手动设置 GPU 风扇速度。

当我创建包含以下内容的 xorg.conf 文件时:

Section "Device"
     Identifier      "Device0"
     Driver          "nvidia"
     VendorName      "NVIDIA"
     Option          "Coolbits" "4"
EndSection

Section "Device"
     Identifier      "Device1"
     Driver          "nvidia"
     VendorName      "NVIDIA"
     Option          "Coolbits" "4"
EndSection

Section "Device"
     Identifier      "Device2"
     Driver          "nvidia"
     VendorName      "NVIDIA"
     Option          "Coolbits" "4"
EndSection

然后重新启动,然后运行:

nvidia-settings -a [gpu:0]/GPUFanControlState=1 -a [fan:0]/GPUTargetFanSpeed=80

这很好用。当我运行:

nvidia-settings -a [gpu:1]/GPUFanControlState=1 -a [fan:1]/GPUTargetFanSpeed=80

我收到一个错误:

错误:按照赋值“[fan:1]/GPUTargetFanSpeed=80”中的规定将值 80 分配给属性“GPUTargetFanSpeed”(this-box:0[fan:1])时出错(未知错误)。

当我跑步时:

nvidia-xconfig --enable-all-gpus
nvidia-xconfig --cool-bits=4

然后重启,我得到一个带有白色光标的黑屏。我尝试对上面 2 行生成的 xorg.conf 进行多次修改,但除了本文开头的基本 xorg.conf 之外,无法使用任何其他方法解决黑屏问题 - 它不允许在风扇 1 或 2 上更改风扇速度

答案1

我有完全相同的配置 - 18.04 上有 3 个 GPU。通过将物理显示器连接到主显示器之外的 2 个辅助 GPU 中的每一个,并为两个额外显示器中的每一个创建一个新的 x 屏幕,使其工作X Server Display Configuration。同一台显示器上的不同端口可能也可以工作。

我的 nvidia 设置的截图:

https://drive.google.com/open?id=1Rh2YnbK0VSPHH-JnSLLYUx7eCw7yQ2qG

然后我将Save to X Configuration File -> Show Preview内容复制并粘贴到文本文件中并另存为/etc/X11/xorg.conf。然后我在forOption "Coolbits" "28"下添加了行,和。Section "Device"Device0Device1Device2

现在看起来是这样的:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 418.87.00

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    Screen      2  "Screen2" RightOf "Screen1"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "ViewSonic VT2430-M"
    HorizSync       15.0 - 82.0
    VertRefresh     55.0 - 75.0
    Option         "DPMS"
EndSection

Section "Monitor"
    # HorizSync source: unknown, VertRefresh source: unknown
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "BenQ GW2750H"
    HorizSync       0.0 - 0.0
    VertRefresh     0.0
    Option         "DPMS"
EndSection

Section "Monitor"
    # HorizSync source: unknown, VertRefresh source: unknown
    Identifier     "Monitor2"
    VendorName     "Unknown"
    ModelName      "DELL ST2420L"
    HorizSync       0.0 - 0.0
    VertRefresh     0.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1080 Ti"
    BusID          "PCI:67:0:0"
    Option "Coolbits" "28"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "TITAN Xp COLLECTORS EDITION"
    BusID          "PCI:10:0:0"
    Option "Coolbits" "28"
EndSection

Section "Device"
    Identifier     "Device2"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1080 Ti"
    BusID          "PCI:66:0:0"
    Option "Coolbits" "28"

EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "1920x1080 +0+0 {AllowGSYNC=Off}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen2"
    Device         "Device2"
    Monitor        "Monitor2"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "1920x1080 +0+0 {AllowGSYNC=Off}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

重新启动并且风扇设置在所有 GPU 上起作用:

https://drive.google.com/open?id=1XzSD-SOHLub57zlekiI9-zvypJklnQQW

编辑:让它在另一台有 3 个 GPU 但使用 16.04 的机器上运行,无需连接额外的物理显示器。首先运行nvidia-xconfig --enable-all-gpus,然后编辑 xorg.conf 文件以在 下添加行Option "Coolbits" "28",并像以前一样。它看起来像这样:Section "Device"Device0Device1Device2

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 418.67


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    Screen      1  "Screen1" RightOf "Screen0"
    Screen      2  "Screen2" RightOf "Screen1"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor2"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 2070"
    BusID          "PCI:3:0:0"
    Option "Coolbits" "28"  
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 2070"
    BusID          "PCI:4:0:0"
    Option "Coolbits" "28"    
EndSection

Section "Device"
    Identifier     "Device2"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1080 Ti"
    BusID          "PCI:5:0:0"
    Option "Coolbits" "28"   
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen2"
    Device         "Device2"
    Monitor        "Monitor2"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

重新启动后风扇设置正常。

但不确定它是否能在 18.04 上运行。我不想弄乱我的配置,所以没有在 18.04 机器上尝试。

相关内容