You are not logged in.

#1 2012-09-23 18:16:50

adam777
Member
Registered: 2012-05-28
Posts: 158

[Solved] Can't Set Radeon Power Profile On Boot

* Solution At The Bottom Of The Post *

Hello all,
Having finally moved to Arch full time, and despite making sure pretty much everything work before making a clean installation, I'm having the problem the title says.
No matter what I try, it does not seem to work on my clean Systemd installation (mixed, that is using init=/bin/systemd).

What I tried:
1. Trying the old-school /etc/rc.local
The rc.local compatibility service fails on boot and profile stays at "default".

2. Trying to use a temporary file as the wiki suggests (https://wiki.archlinux.org/index.php/Sy … rary_files).
Using the exact syntax as the echo example gives, nothing happens, profile stays at "default".

3. Using a custom service adopted from the good guys at the gentoo WIki (http://en.gentoo-wiki.com/wiki/Systemd# … er_profile).
Nothing happens on boot, profile stays at default.
What's interesting is:
a. It has worked flawlessly in my test-installations (in plural).
b. Restarting the service after boot (systemctl restart) cause the desired effect (profile sets to "low").
c. Systemd claims some weird thing regarding the service, and as mentioned above, running it manually works just fine.

radeon-power_profile.service - Radeon Power Profile
          Loaded: loaded (/etc/systemd/system/radeon-power_profile.service; enabled)
          Active: inactive (dead) since Sun, 23 Sep 2012 19:55:50 +0200; 15min ago
         Process: 229 ExecStart=/usr/local/sbin/radeon-power_profile low (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/radeon-power_profile.service

Sep 23 19:55:50 admdgn radeon-power_profile[229]: cat: /sys/class/drm/card0/device/power_profile: No such file or directory
Sep 23 19:55:50 admdgn radeon-power_profile[229]: /usr/local/sbin/radeon-power_profile: line 30: /sys/class/drm/card0/device/power_profile: No such file or directory

d. The script has #!/bin/sh as needed, and is marked as executable with chmod +x.

Thanks, Adam.

* EDIT *
OK, it's more messy than I thought.
Having played with it a bit more, in one of the boots the value was written correctly.
It's no big surprise as the service on its own do what it's supposed to.
It seems to be some sort of weird timing issue.

* EDIT 2 *
Yet again Google to the rescue.
After I managet to not succeed using 3 different methods, turns out there is a 4th one.
I added a call to the script with the needed parameter ("/usr/local/sbin/radeon-power_profile low") to KDM's Xsetup file (/usr/share/config/kdm) where it's supposed to be run as root prior to login dialog.
It seems it indeed run as expected, and so far computer always boots with radeon set to low profile as expected.

Last edited by adam777 (2012-09-23 20:24:22)

Offline

#2 2012-10-04 19:31:19

adam777
Member
Registered: 2012-05-28
Posts: 158

Re: [Solved] Can't Set Radeon Power Profile On Boot

OK, just a quick follow up.
After a (successful) KDE upgrade to 4.9.2 that unfortunately wiped my Xsetup file, I decided to give the service approach another try, since it's "cleaner" any way.
This time, however, I decided to launch the service late in the boot sequence by adding the following to the service file:

[Unit]
Description=Radeon Power Profile
Requires=kdm.service
After=kdm.service

Works like a charm.

Offline

#3 2012-12-17 11:11:18

ReinisFMF
Member
Registered: 2012-03-10
Posts: 3

Re: [Solved] Can't Set Radeon Power Profile On Boot

Here is my take on this timing problem. I don't know if this is the correct way to go about this, but it works for me.

To make systemd wait for the card:

[Unit]
Description=Radeon Power Profile
Requires=dev-dri-card0.device
After=dev-dri-card0.device

Here "dev-dri-card0.device" refers to /dev/dri/card0

But for this to work we have to make a rule file for udev (e.g., /etc/udev/rules.d/drm.rules) with these contents:

SUBSYSTEM=="drm", TAG+="systemd"

This allows systemd to "see" the device.

Last edited by ReinisFMF (2012-12-17 11:12:22)

Offline

#4 2012-12-17 17:54:42

flocke
Member
From: Magdeburg
Registered: 2010-06-14
Posts: 5
Website

Re: [Solved] Can't Set Radeon Power Profile On Boot

Or you could use just a udev rule:

[flocke@toybox ~]# cat /etc/udev/rules.d/40-radeon.rules 
KERNEL=="card0", SUBSYSTEM=="drm", DRIVERS=="radeon", ATTR{device/power_method}="profile", ATTR{device/power_profile}="low" RUN+="/usr/bin/find /sys/class/drm/card0/device/ -name power_* -exec /bin/chmod 664 {} ; -exec /bin/chown root:radeon {} ;"

The RUN-part changes the permissions of the power_methode and power_profile files to be writable by the group 'radeon', you can leave this out or create the radeon group and add your user to it to be able to change the profile without being root.

Offline

Board footer

Powered by FluxBB