How can I overclock a graphics card from within Ubuntu?
Solution 1
You almost had it. Coolbits is the way. Here's my device in /etc/X11/xorg.conf
:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 260"
Option "Coolbits" "1"
Option "NoLogo" "True"
EndSection
And then (after restarting X - control+alt+f1, sudo restart gdm
), load up nvidia-settings
and there's a Clock Frequencies page:
Solution 2
2018 Answer
To enable overclocking, run:
nvidia-xconfig --cool-bits=28
Reboot your PC. Now you can do things like:
# List all GPUs
# Set power to 100W, +1000 Mhz Mem clock offset, and +100 Mhz on GPU clock offset.
nvidia-settings -c :0 -q gpus
nvidia-smi -i 0 -pl 100
nvidia-settings -c :0 -a '[gpu:0]/GPUMemoryTransferRateOffset[2]=1000'
nvidia-settings -c :0 -a '[gpu:0]/GPUGraphicsClockOffset[2]=100'
The adventage of this method is that you can change the power input. Potential harm risk. Proceed with careful. Source here
Solution 3
For anyone tackling this question in 2021:
I searched the issue with my Ubuntu distro (20.0.2)
The file is now located in /usr/share/X11/xorg.conf.d/10-nvidia.conf
I set
Option "Coolbits" "28"
Restarted the GDM using
systemctl restart gdm.service
You will also need to run to enable multiple GPUs:
sudo nvidia-xconfig --enable-all-gpus
HotTip when using the GUI: You need to press Enter
when editing the GPU clock or memory values in order for changes to be applied. You'll know they were applied because some text will appear in the bottom left side saying that the value was set
You should also note that the options are now nested in PowerMizer and look different than Screencapped here
This method also works for Ubuntu version 21.04
Solution 4
There are also the following tools in the default Ubuntu repositories that you can install from the Software Center or from the terminal:
NVIDIA - for Ubuntu <=14.04
nvclock
- Allows you to overclock Nvidia cards
nvclock-gtk
- Nvclock but with GTK support
nvclock-qt
- Nvclock but with QT support
ATI - for all currently supported versions of Ubuntu
rovclock
- Allows you to overclock ATI cards
Solution 5
For anyone having issues with GPUMemoryTransferRateOffset
, I created a script using GPUMemoryTransferRateOffsetAllPerformanceLevels
which you can find in this related question: https://askubuntu.com/a/1368739/1434762
Related videos on Youtube
Comments
-
M. Tibbits over 1 year
I would like to boost the Core frequency, shader clock, and memory clock on an eVGA GTX 480 I have in my development box running 10.04. Is it possible to overclock a recent graphics card from within Ubuntu? I tried the Coolbits approach, but I couldn't get this to work. I also tried nvclock, but as it has't been updated since January, 4th, 2009, it doesn't work with my card.
In windows, the driver itself ships with the ability to overclock the cards, but nvidia appears to have left this out of the linux drivers. Has anyone discovered a solution? Or would it be possible to stage the windows drivers within Ubuntu? (ick)
If there is a more appropriate forum to ask this question in, I'd be happy to do so -- but I'm hoping for a solution within Ubuntu. Thanks!
Update: It appears that I may need to have "Coolbit" "5" as discussed here. Hmm. Nope.
Here is the relevant section of my xorg.conf file:
Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 460" BusID "PCI:2:0:0" Option "Coolbits" "5" Option "NoLogo" "True" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 480" BusID "PCI:3:0:0" Option "Coolbits" "5" Option "NoLogo" "True" EndSection
When I restart with Coolbits set to 5, I can enable fan control on GTX 460. I can also set it to maximum performance mode. I cannot change the clock frequencies. I am about to try different levels. But here is what I see (with Coolbits = 5):
Update 2: I've tried driver version - 260.24(beta - nvdeveloper) & 260.19.12 (released today). I am not able to see the "Clock Frequencies" tab for any of the 4xx cards. I can however alter the fan speed for the card with a display attached. I'm going to ask a second question and wait for better drivers to be released.
-
Admin over 13 yearsNote: if you copied the code straight off that coolbits explanation, you would have copied curly-quotes, not straight
"
s. That might explain why it didn't work for you. -
Admin over 13 yearsI didn't copy it, I just typed in the changes by hand. I'm going to update my question with my xorg file. It's still not working with Coolbits.
-
Admin over 13 yearsIt appears that the "4" bit enables fan control, but only if you have a display attached. But not clock frequencies. I'm currently running Driver version 260.24 (only available on the nvdeveloper site). Guess we'll just have to wait for support to come to the 4xx series.
-
Admin over 13 yearsTypical Nvidia...
-
-
M. Tibbits over 13 yearsJust to note: (Why I haven't accepted this answer) The above configuration does not work for the 4xx series cards. The support has not yet been merged into the public driver stack. Still waiting / begging nVidia...
-
Oli over 13 yearsYeah Fermi support is lagging but when it does get here, this will be the way to enable it. The only other way I've ever seen is using Nibitor to edit the firmware on the card. Sounds a lot more destructive but if you need to edit the clocks, it's an option.
-
M. Tibbits over 13 yearsHonestly, I don't care about the clocks - I'm running intensive CUDA programs and the fans stay at around 45% speed and keep the cards at 75C - 80C which I think is too hot. In windows, it's easy to crank the fans up to 90% and keep the cards at 50C under full load. Ps. I've now also checked the newest drivers up through: 260.19.29. Still no dice. C'mon nVidia!
-
Admin over 10 yearsIt doesn't work for newer devices; and when I force it with
-f
, it shows a negative (obviously incorrect) clock speed. -
Adrian Lopez about 6 yearsTo make changes permanent: sudo nvidia-smi -pm 1
-
Adrian Lopez about 6 yearsGRAPHICAL WAY: Enable the coolbits, reboot, open nvidia settings, and look for PowerMizer. You won't be able to OC the power input in graphical mode.
-
Sandu Ursu almost 4 yearsWhen the GPU is overclocked this way, would it result in any given frequency running at a lower voltage?
-
Sandu Ursu almost 4 yearsWhen the GPU is overclocked this way, would it result in any given frequency running at a lower voltage?
-
Adrian Lopez almost 4 yearsVoltage won't change. Only the power input. OC wise, the results are 99% the same.
-
Sandu Ursu almost 4 years
-
user3103905 almost 3 yearsThis option enabled
Editable Performance Levels
within PowerMizer, but not able to save changes either via UI or CLI. I am running Ubuntu 20.04 with 1660 Super on a Dell XPS 8940. Not sure if Dell has disabled overclocking in the OEM GPU. -
user5359531 over 2 yearsIs there an equivalent for AMD cards?
-
Greenonline over 2 yearsIf the Github repository ever disappears, sometime in the future, then your answer won't be much use. Therefore, in addition to providing the link to the script in your answers, as the script isn't very long, you could also edit your answers to include the script.
-
paradox over 2 yearsThanks. Added reference to another thread which is newer and actually contains it. Hope that's fine?