Page 1 of 1

[SOLVED] Editing my GPU's power profile (AMD 5870)

PostPosted: Apr 17th, '13, 20:48
by VoodooDali
Hello:

My GPU (AMD Radeon Mobility HD 5870) runs very hot (about 187 degrees F) while using the open-source "radeon" driver. I could switch to the AMD Catalyst Driver but that no longer works in Netflix, YouTube, ESPN3 and a bunch of other video applications.

I can cool down my GPU by running the following command as root:

Code: Select all
echo low > /sys/class/drm/card0/device/power_profile


However, this is a temporary fix. Exiting su/root mode causes my sound to cut out. :shock: And, next time I reboot, my power profile will be set back to "auto" which runs very hot.

Anyone know how I can *permanently* alter my power profile? (There really needs to be a GUI-based tool for this tweak :lol: ) Thanks!

Re: Editing my GPU's power profile (AMD 5870)

PostPosted: Apr 18th, '13, 04:49
by oj
Sounds like a job for /etc/rc.d/rc.local. You have to enable rc.local compatibility if your OS uses systemd.

Re: Editing my GPU's power profile (AMD 5870)

PostPosted: Apr 23rd, '13, 00:08
by VoodooDali
oj wrote:Sounds like a job for /etc/rc.d/rc.local. You have to enable rc.local compatibility if your OS uses systemd.


Is there a command to enable rc.local compatibility? I tried using systemctl to enable the rc-local.service, and got a rather lengthy error message. :/

Re: Editing my GPU's power profile (AMD 5870)

PostPosted: Apr 23rd, '13, 10:35
by sander85
VoodooDali wrote:
oj wrote:Sounds like a job for /etc/rc.d/rc.local. You have to enable rc.local compatibility if your OS uses systemd.


Is there a command to enable rc.local compatibility? I tried using systemctl to enable the rc-local.service, and got a rather lengthy error message. :/


It's actually quite easy:

From the systemd unit (/lib/systemd/system/rc-local.service):
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.

So all you have to do is create /etc/rc.d/rc.local and make it executable.

Re: Editing my GPU's power profile (AMD 5870)

PostPosted: Apr 23rd, '13, 13:53
by VoodooDali
For the benefit of anyone else trying to do this, here's what worked, step by step.

I had to create a file called rc-local.service with the following contents:

Code: Select all
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/bin/sh /etc/rc.local
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
Alias=rc-local.service


Then I created an rc.local file with the following:

Code: Select all
echo mid > /sys/class/drm/card0/device/power_profile


I set these files to executable in Dolphin, then moved the files to where they belonged by running the following as root:

Code: Select all
mv rc.local /etc
mv rc-local.service /etc/systemd/system


I changed ownership of the files to root:

Code: Select all
chown root /etc/rc.local
chown root /etc/systemd/system/rc-local.service


I enabled rc.local compatibility in systemd and started the service:

Code: Select all
systemctl enable rc-local.service
systemctl start rc-local.service


I received errors for both the systemctl commands, but when I rebooted, my GPU was running at the cooler temperature, and a check of

Code: Select all
 cat /sys/class/drm/card0/device/power_profile


reported the value "mid". Success. :D

Re: [SOLVED] Editing my GPU's power profile (AMD 5870)

PostPosted: Apr 23rd, '13, 13:59
by VoodooDali
Special thanks to:

-defektz at fedoraforums.org
-TobiSGD at linuxquestions.org
-oj and sander85, right here :D