Howto: radeon driver tweaking

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
eanfrid

Howto: radeon driver tweaking

Post by eanfrid »

Xorg hardware auto-setting chooses sometimes wrong defaults for your GPU. Here are the basics to overcome some common troubles with AMD GPUs using the open-source radeon driver (package "xserver-xorg-video-radeon"). Depending on your actual GPU model, some options may have different default values and/or options may have no effect at all.

1/ Create a device.conf file under the "/etc/X11/xorg.conf.d" folder

Code: Select all

sudo touch /etc/X11/xorg.conf.d/device.conf
2/ Add the basic content

Code: Select all

sudo nano /etc/X11/xorg.conf.d/device.conf
and then add

Code: Select all

Section "Device"
	Identifier	"my_device"
	Driver	"radeon"
EndSection
3/ Add the configuration options that will override Xorg auto-detection by editing once again the "device.conf" file

Code: Select all

sudo nano /etc/X11/xorg.conf.d/device.conf
disable unnecessary video sync for performance (tearing will probably appear though)

Code: Select all

	Option		"SwapbuffersWait"	"off"
circumvent the dreaded "black screen with mouse pointer" once logged in your DE

Code: Select all

	Option		"ColorTiling2D"		"off"
force your GPU to use the best adaptative powersaving mode

Code: Select all

	Option		"DynamicPM"		"on"
if you enabled these 3 lines you will have now something like:

Code: Select all

Section "Device"
	Identifier	"HD6770"
	Driver	"radeon"
	Option		"SwapbuffersWait"	"off"
	Option		"ColorTiling2D"		"off"
	Option		"DynamicPM"		"on"
EndSection
4/ Read the manual: "man radeon.conf" for many more tweaking options that can make your GPU work the way you want.

5/ Check what is going on:

Code: Select all

cat /var/log/Xorg.0.log
will actually show you which options were loaded and which features were applied or auto-detected

Additional information about the radeon open-source driver features and available settings can be found on Xorg website:
http://www.x.org/wiki/RadeonFeature
eanfrid

Re: Howto: radeon driver tweaking

Post by eanfrid »

Regarding overheating while using this driver, you can create a script to switch to more appropriate parameters.

1/ Create and store this "radeonclk" script in "/usr/local/bin"

Code: Select all

#!/bin/bash
# radeonclk

case $1 in

    dyn)
	echo "dynpm" > /sys/class/drm/card0/device/power_method
        ;;
    low)
        echo "profile" > /sys/class/drm/card0/device/power_method && echo "low" > /sys/class/drm/card0/device/power_profile
	;;
    mid)
        echo "profile" > /sys/class/drm/card0/device/power_method && echo "mid" > /sys/class/drm/card0/device/power_profile
	;;
    auto)
        echo "profile" > /sys/class/drm/card0/device/power_method && echo "auto" > /sys/class/drm/card0/device/power_profile
	;;
    *)
	echo "Usage: radeonclk (dyn|low|mid|auto)"
	exit 1
	;;
esac
echo "Mode radeon: $(cat /sys/class/drm/card0/device/power_method) $(cat /sys/class/drm/card0/device/power_profile)"
then make it executable with

Code: Select all

sudo chmod +x /usr/local/bin/radeonclk
2/ Usage

The script can be used manually with (for example):

Code: Select all

sudo radeonclk dyn
The script will output the new profile you just chose and if you don't pass any parameter, the command will return its usage syntax instead.

The "dynamic" (dyn param) power method is the most efficient performance/powersaving mix but the less compatible with special configs. The "low" option of the "profile" power method is the most efficient powersaving mode, at the expense of performance. None of these two modes is the default running state (default is "auto") of the radeon driver, so users complaining of overheating should try one of these two modes. For example, on my HD6770 I get these average temperatures in common desktop use:

dyn (aka "dynamic" power method): 60°C - 66°C in summer / best overall performances
auto (aka "profile" power method, auto profile): 66°C - 70°C in summer
mid (aka "profile" power method, medium profile): 63°C / good performances
low (aka "profile" power method, low power profile): 45°C - 48°C in summer / slowest performance

I never use the "high" profile method since the GPU will unnecessarily always run at full speed.
Post Reply

Return to “Tutorials”