Created
May 4, 2021 16:14
-
-
Save Hinaser/e4af0a87d37bee410f8cfcf1c7a433e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# References | |
# https://u2pia.medium.com/ubuntu-20-04-nvidia-gpu-control-through-ssh-terminal-bb136f447e11 | |
# https://unix.stackexchange.com/questions/367584/how-to-adjust-nvidia-gpu-fan-speed-on-a-headless-node | |
# This gist is for GPU configuration for mining on Ubuntu 20.04 | |
# This worked with dual GPU machine (GTX1070/RTX3070). | |
# Set coolbits which enables to control all gpu fan/clock via command line | |
sudo nvidia-xconfig -a --cool-bits=28 | |
# Edit xorg.conf.d/10-nvidia-.conf | |
sudo vi /usr/share/X11/xorg.conf.d/10-nvidia.conf | |
# Edit like below | |
``` | |
Section "OutputClass" | |
Identifier "nvidia" | |
MatchDriver "nvidia-drm" | |
Driver "nvidia" | |
Option "AllowEmptyInitialConfiguration" | |
Option "Coolbits" "28" # <-- ADD THIS LINE | |
ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg" | |
EndSection | |
``` | |
# Reboot | |
sudo shutdown -r now | |
### After reboot ### | |
# Search for Xauthority | |
sudo ls -AFlh /run/user/$(id -u gdm)/gdm/ | |
# If you find `Xauthority*` file, then you can control gpu fan/clocks | |
# Set config options | |
sudo DISPLAY=:0 XAUTHORITY=/run/user/$(id -u gdm)/gdm/Xauthority nvidia-settings \ | |
--assign [gpu:0]/GPUFanControlState=1 \ | |
--assign [gpu:1]/GPUFanControlState=1 \ | |
--assign [fan:0]/GPUTargetFanSpeed=80 \ | |
--assign [fan:1]/GPUTargetFanSpeed=60 \ | |
--assign [gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=-200 \ | |
--assign [gpu:0]/GPUMemoryTransferRateOffsetAllPerformanceLevels=250 | |
--assign [gpu:1]/GPUGraphicsClockOffsetAllPerformanceLevels=-130 \ | |
--assign [gpu:1]/GPUMemoryTransferRateOffsetAllPerformanceLevels=900 | |
# Enable power limit configuration | |
sudo nvidia-smi -pm 1 | |
# This sets pl to 120W | |
sudo nvidia-smi -i 0 -pl 115 | |
sudo nvidia-smi -i 1 -pl 130 | |
# Monitor gpu temperature | |
nvidia-smi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment