How To Configure Nvidia Settings For Linux Crypto Mining On Headless Ubuntu System

Before I start, here are the two most important gists:


My overclock script (use settings at your own risk)

Useful Commands

These are not entirely necessary, but they might be useful.

List all the cards:

lspci -v | grep -A 2 -E "(VGA comp|3D)"
nvidia-smi -L
OR (if you want a lot of detail including serial numbers for GPU 0, 1,2, and 3)
nvidia-smi -i 0,1,2,3 -q
Step 1 – Disable GUI Boot
sudo systemctl set-default multi-user
Step 2- Install X11

I normally cheat, by installing x11-apps. I think you can do xterm here without x11-apps, but who doesn’t like xeyes?

sudo apt install x11-apps
sudo apt install xterm
sudo echo "allowed_users=anybody" > /etc/X11/Xwrapper.config
Step 3 – Get the Correct Drivers
sudo add-apt-repository ppa:graphics-drivers/ppa

# Get the driver version (I think)
sudo ubuntu-drivers devices

# And install the version from the last step
sudo apt install -y nvidia-driver-[460]
Step 4 – Configure Nvida settings to allow overclocking in a headless configuration:
nvidia-xconfig -a --allow-empty-initial-configuration --cool-bits=28 --use-display-device="DFP-0" --connected-monitor="DFP-0"
Step 5 – Configure xinit so it can be run remotely

Enable xinit for ssh users by changing the Xwrapper.config to anybody (from console).

Step 6 – Start xinit (preferably in tmux)
Step 7 – Lets do so Overclocking now
# List cards
nvidia-sml -L

# Enable persistence mode
nvidia-smi -pm ENABLED

# 3070
# Reduce Power for 3070's from 200W
sudo nvidia-smi -pl 130 -i 0
sudo nvidia-smi -pl 130 -i 1
sudo nvidia-smi -pl 130 -i 3

nvidia-settings -c :0 -a '[gpu:0]/GPUGraphicsClockOffset[4]=-500' -a '[gpu:0]/GPUMemoryTransferRateOffset[4]=1100'
nvidia-settings -c :0 -q '[gpu:0]/GPUGraphicsClockOffset[4]' -q '[gpu:0]/GPUMemoryTransferRateOffset[4]' --ctrl-display=:0

nvidia-settings -c :0 -a '[gpu:1]/GPUGraphicsClockOffset[4]=-500' -a '[gpu:1]/GPUMemoryTransferRateOffset[4]=1100'
nvidia-settings -c :0 -q '[gpu:1]/GPUGraphicsClockOffset[4]' -q '[gpu:1]/GPUMemoryTransferRateOffset[4]' --ctrl-display=:0

# 2080
sudo nvidia-smi -pl 155 -i 0
nvidia-settings -c :0 -a '[gpu:0]/GPUMemoryTransferRateOffset[3]=1300'
nvidia-settings -c :0 -a '[gpu:0]/GPUGraphicsClockOffset[3]=-50'

# 1080
sudo nvidia-smi -pl 135 -i 2
nvidia-settings -c :0 -a '[gpu:2]/GPUMemoryTransferRateOffset[3]=1300'
nvidia-settings -c :0 -a '[gpu:2]/GPUGraphicsClockOffset[3]=100'

# Query to Check
nvidia-settings --query [gpu:0]/GPUPerfModes --ctrl-display=:0

How much power are you drawing:

$ nvidia-smi -q -d power

Increase the power limit for CPU 1:

Potential ERRORS

Console Only xinit


/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server


Change /etc/X11/Xwrapper.config


ERROR: Unable to load info from any available system

If you’re running headless, make sure you specify the ctrl-display to :0.

nvidia-settings -a "[gpu:0]/GPUMemoryTransferRateOffset[3]=975" --ctrl-display=:0
Query Card Options

nvidia-settings –query [gpu:0]/GPUPerfModes –ctrl-display=:0

Some of My Overclock Settings

Useful References

Leave a Reply

Your email address will not be published. Required fields are marked *