Ricks-Lab / gpu-utils

A set of utilities for monitoring and customizing GPU performance
GNU General Public License v3.0
140 stars 23 forks source link

Extended Support - NV Write Capability #94

Open Ricks-Lab opened 4 years ago

Ricks-Lab commented 4 years ago

Considering extending capabilities to support of NV to gpu-pac.

Ricks-Lab commented 4 years ago

Originally posted by @KeithMyers in #83 (comment)

I was reading through the readme and saw the disclaimer that the utilities can only write to AMD cards. Would you consider adding that function to Nvidia cards? There are two Nvidia applications that are used to write to Nvidia cards. One of them, nvidia-smi you already know about and use. You can set power levels with nvidia-smi for example.

The other Nvidia utility that can write to their cards is nvidia-settings. It is included with the driver package also like nvidia-smi. Nvidia-settings can be used to control fans and core clocks and memory clocks. I don't know if you realized that was possible in Linux. This is an example of how I set up my cards on my daily driver. It is simply a bash file that I run every time I boot.

#!/bin/bash

nvidia-smi -i 0 -pl 200
nvidia-smi -i 1 -pl 200
nvidia-smi -i 2 -pl 200

/usr/bin/nvidia-settings -a "[gpu:0]/GPUPowerMizerMode=1"
/usr/bin/nvidia-settings -a "[gpu:1]/GPUPowerMizerMode=1"
/usr/bin/nvidia-settings -a "[gpu:2]/GPUPowerMizerMode=1"

/usr/bin/nvidia-settings -a "[gpu:0]/GPUFanControlState=1"
/usr/bin/nvidia-settings -a "[fan:0]/GPUTargetFanSpeed=100"
/usr/bin/nvidia-settings -a "[fan:1]/GPUTargetFanSpeed=100"
/usr/bin/nvidia-settings -a "[gpu:1]/GPUFanControlState=1"
/usr/bin/nvidia-settings -a "[fan:2]/GPUTargetFanSpeed=100"
/usr/bin/nvidia-settings -a "[fan:3]/GPUTargetFanSpeed=100"
/usr/bin/nvidia-settings -a "[gpu:2]/GPUFanControlState=1"
/usr/bin/nvidia-settings -a "[fan:4]/GPUTargetFanSpeed=100"
/usr/bin/nvidia-settings -a "[fan:5]/GPUTargetFanSpeed=100"

/usr/bin/nvidia-settings -a "[gpu:0]/GPUMemoryTransferRateOffset[4]=800" -a "[gpu:0]/GPUGraphicsClockOffset[4]=40"
/usr/bin/nvidia-settings -a "[gpu:1]/GPUMemoryTransferRateOffset[4]=800" -a "[gpu:1]/GPUGraphicsClockOffset[4]=40"
/usr/bin/nvidia-settings -a "[gpu:2]/GPUMemoryTransferRateOffset[4]=800" -a "[gpu:2]/GPUGraphicsClockOffset[4]=40"

I first limit the power level to 200 W down from stock 225W or my 2080's. Then I set all the fans on the cards to 100% fan speed. Then I increase the memory clocks by 800Mhz and the core clocks to 40Mhz.

The reason I increase the memory clocks is that all Nvidia consumer cards above entry level are hamstrung and penalized by the Nvidia drivers to run in P2 power state when the driver detects the card running a compute load. So I add the 800Mhz of memory clock on top of the default penalized P2 memory clock to get the card running at its normal P0 power state clocks if the card was simply driving a gaming graphics load. The additional 40Mhz of core clocks is really just a token bump. The card will already run at its highest core clock based on the thermal and power limit headroom the card has and is already managed by the default firmware GPU Boost 3.0 algorithm running.

I am just providing some examples of the possibility of controlling and writing parameter changes to Nvidia cards. Not actually requesting you add those functions. Up to you to decide if you want to tackle that.