0

I am using Ubuntu 20.04 with 2 RTX 3070 GPUs, which I want to use for ETH mining, on an ASUS B250 Mining Expert motherboard. I have installed all needed software on a new Ubuntu 20.04 installation like this:

sudo -i
apt install nvidia-driver-460
nvidia-xconfig -a --cool-bits=28
reboot
  • I checked my /etc/X11/xorg.conf file and coolbits = 28 was written in all 3 GPUs, which is OK.

  • I tested nvidia-smi Undervoltage/Powerlimit (pl) for all GPUs, using:

    nvidia-smi -pl 120
    

    and it also works, since mining with T-Rex the power limit is seen, which is OK.

  • I tested nvidia-serttings fan for all GPUs like this:

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

    and it also works. The fans start at once running faster.

  • When I open the NVIDIA X Server Settings app, I can manually change under each GPU's PowerMizer option the values for Graphics Clock Offset and Memory Transfer Rate Offset. After pressing Enter the value becomes active. When mining with T-Rex, the Hash-Rate goes up, which is OK.

So everything works fine, but I want to do all the above in an automated way using a shell script, which I have tried.

BUT: Overclocking is not running with these commands from the terminal. Even the prompt answer is Attribute ... assigned ... as you can see below:

$ nvidia-settings -a GPUGraphicsClockOffset[3]=-500
Attribute 'GPUGraphicsClockOffset' (katzminer-desktop:0.0) assigned to value -500.
Attribute 'GPUGraphicsClockOffset' (katzminer-desktop:0.1) assigned to value -500.
Attribute 'GPUGraphicsClockOffset' (katzminer-desktop:0[gpu:0]) assigned to value -500.
Attribute 'GPUGraphicsClockOffset' (katzminer-desktop:0[gpu:1]) assigned to value -500.
$ nvidia-settings -a GPUMemoryTransferRateOffset[3]=2200
Attribute 'GPUMemoryTransferRateOffset' (katzminer-desktop:0.0) assigned to value 2200.
Attribute 'GPUMemoryTransferRateOffset' (katzminer-desktop:0.1) assigned to value 2200.
Attribute 'GPUMemoryTransferRateOffset' (katzminer-desktop:0[gpu:0]) assigned to value 2200.
Attribute 'GPUMemoryTransferRateOffset' (katzminer-desktop:0[gpu:1]) assigned to value 2200.

When I check the NVIDIA X Server Settings app, under each GPU's PowerMizer option, the value for GPUGraphicsClockOffset and GPUMemoryTransferRateOffset is still 0.

What am I doing wrong?

I also tried for each GPU without success:

nvidia-setttings -c :0 -a '[gpu:0]/GPUMemoryTransferRateOffset[3]=2200'
nvidia-settings -c :0 -a '[gpu:0]/GPUGraphicsClockOffset[3]=-500'

Do I need to use sudo before nvidia-settings?

Or do I need to set persistency mode before like this:

nvidia-smi --persistence-mode=1

Do I have to set PowerMizer-Mode too?

Is my installation of the NVIDIA drivers correct ? Because in a forum I also saw that users install the NVIDIA drivers this way:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install ubuntu-drivers-common
sudo apt install nvidia-driver-460 
sudo reboot

All help is much appreciated.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Konny123
  • 11
  • 1
  • 2

1 Answers1

3

After a lot of struggle I found a way to make this work and created a repo.

You can find the complete working script below and also in GitHub:

#!/bin/sh

# README
# Before proceeding make sure that you set your coolbits to 31
# Open a terminal and do
# $ sudo nvidia-xconfig -a --cool-bits=31 --allow-empty-initial-configuration

# To be able to set the power limit you need to enable sudo commands without password
# Do 
# $ sudo visudo
# And then at the end of the file add the following while changing username to your user
# Note the tabs after username as otherwise it won't work
# username        ALL = (ALL) NOPASSWD: /usr/bin/nvidia-persistenced
# username        ALL = (ALL) NOPASSWD: /usr/bin/nvidia-smi
# Reboot the system now and continue setting the OC limits 

# =========================== Define OC limts ===========================================
# Fans speed is in %
POWER_LIMIT=150
FANS_SPEED=65
GPU_OFFSET=200
# Memory offset has to be the actual desired amount.
MEMORY_OFFSET=1300

# ========================================================================================
# It is advisable not to change anything below this line if you don't know what you are doing

SET='/usr/bin/nvidia-settings'

#Set Power Limit
sudo nvidia-smi -pl $POWER_LIMIT

# Set power persistence mode to ON so your power limit setting can persist even no UI app is running
${SET} -a [gpu:0]/GpuPowerMizerMode=1

# Set fan target level
${SET} -a [gpu:0]/GPUFanControlState=1

${SET} -a [fan:0]/GPUTargetFanSpeed=$FANS_SPEED
${SET} -a [fan:1]/GPUTargetFanSpeed=$FANS_SPEED

# Set clocks speeds
${SET} -a [gpu:0]/GPUGraphicsClockOffsetAllPerformanceLevels=$GPU_OFFSET

ACTUAL_MEMORY_OFFSET=$(( MEMORY_OFFSET*2 ))
${SET} -a [gpu:0]/GPUMemoryTransferRateOffsetAllPerformanceLevels=$ACTUAL_MEMORY_OFFSET

#Send notification
notify-send "OC Done: Fans = $FANS_SPEED% | GPU=$GPU_OFFSET | Memory=$MEMORY_OFFSET" -t 4000 -i messagebox_info

Short answer to your question is that there are apparently new properties that you can use. Use GPUGraphicsClockOffsetAllPerformanceLevels and GPUMemoryTransferRateOffsetAllPerformanceLevels instead to make it work.

In theory the [3] in GPUGraphicsClockOffset[3] is the performance level and if you do GPUGraphicsClockOffset[n] for each n as performance level then you should be able to also make it work but I haven't tried that yet.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
paradox
  • 163
  • 11