Linux usually doesn’t have the fancy “gaming” type applications that Windows does. That includes a lot of the graphical GPU management utilities that come in the drivers of the latest graphics cards. As a result, overclocking your cards and getting the most out of them is more difficult than just dragging a slider.
For AMD card owners, the utilities that you need to overclock your card are included in the drivers you already have installed. They just aren’t easily accessible in any graphical tool. You need to modify a few configuration files instead.
Install the Latest Drivers
First, you already have some drivers installed. They may not be the latest ones, though. You can absolutely choose the proprietary drivers if you’re running one of the supported systems.
If you’d prefer the open-source drivers, you probably already have them. If you’re on a system that has a somewhat outdated kernel or Mesa version, you might want to look into options for updating them. On Ubuntu you can use a popular repository to always have the latest.
sudo add-apt-repository ppa:paulo-miguel-dias/mesa sudo apt update sudo apt upgrade
It doesn’t make much of a difference in overclocking, but it will help increase your card’s performance.
Enable the Sensors
Since you are overclocking, you need some way of monitoring your card’s temperature. Again, that functionality comes with the kernel itself. You only need to install the monitoring software.
sudo apt install lm-sensors
Now, run a scan of the sensors on your system.
Run through the options and select the defaults. At the end it will save your settings. Restart the service, then check what output you have.
sudo systemctl restart lm-sensors sensors
If you see output from your card there, you know they’re functioning properly. You can watch the output from a terminal with
watch sensors, or your can use a utility like gkrellm or conky.
Manually Set the Fan Speed (Optional)
Your card will use a PWM setting to control the fan speed automatically based on the card’s temperature, so there’s no pressing reason to set the fan speed manually. However, if you’re serious about overclocking, you might want to manually control the speed for optimal results.
The file that controls your card’s PWM state is:
The card number and “hwmon” number may be different, so check. The default value in the file is “2.” That enables PWM controls. To switch it to manual, change that to “1.”
If you’d prefer a single command:
sudo echo "1" > /sys/class/drm/card0/device/hwmon/hwmon0/pwm1_enable
You can now manually set the fan speed. The control is percentage-based, so you’re going to enter the percentage that you want your fan to run at in “/sys/class/drm/card0/device/hwmon/hwmon0/pwm1.” Of course, you can just echo it in again.
sudo echo "50" > /sys/class/drm/card0/device/hwmon/hwmon0/pwm1
Overclock Your GPU
With your fans set and temperature monitoring enabled, you can begin overclocking your card. AMD’s overclocking settings are percentage-based. The default value is “0.” When you change that to a positive number, the card will increase its frequency by that percent over its default clock rate. So, if you enter a “5,” the card will overclock by 5%.
The first file that you need to modify is “/sys/class/drm/card0/device/pp_sclk_od.” This file controls the card’s GPU clock speed. Enter in the percentage that you want to overclock by. It’s probably not a good idea to enter any value over “10” to start with. You can always change these values and adjust them as you’re testing.
sudo echo "7" > /sys/class/drm/card0/device/pp_sclk_od
You can also overclock the memory following the same method. Again, don’t push it too far to start. Be aware that this is a different file – “pp_mclk_od.”
sudo echo "4" > /sys/class/drm/card0/device/pp_mclk_od
Test It Out
Test out your overclock. You can make sure that your card is running at the speeds that you set by monitoring the card’s information while doing something graphically demanding, like playing a game.
Open a terminal and run the following command.
watch cat /sys/kernel/debug/dri/0/amdgpu_pm_info
While that’s running, open a game or one of the Unigine benchmarks. Run through and watch the terminal output. You should see that both the clock speed and the memory are operating higher than the factory specifications. Be sure to watch the temperature, too. Watch it mostly when the card is functioning at 100%. You don’t want to see anything too high. The max temperature differs greatly by card, so look up your card’s max temperature.
As you go, you can always step up your overclock if there is some room to do so. At the same time, if you’re seeing unreasonable temperatures, dial it back and/or increase the fan speed. Always be careful when overclocking. There is always a very real chance of damaging your hardware.
Also, be aware that your overclock might not stick after a reboot. The easiest way to handle that is with a script that runs on startup. It doesn’t need to be anything complex. Just have the script set the values again.