You are not logged in.

#1 2016-11-28 19:44:05

fazillatheef
Member
Registered: 2015-05-24
Posts: 10

[Solved] Startup script help

Update 28th November 2016 21:30 - fixed using a very easy configuration found from Arch wiki

Persistent configuration for ATI in Arch wiki - Link

KERNEL=="card0", SUBSYSTEM=="drm", DRIVERS=="radeon", ATTR{device/power_dpm_state}="balanced", ATTR{device/power_dpm_force_performance_level}="low"

Put the configuration in the file
/etc/udev/rules.d/30-radeon-pm.rules

Original Post

My laptop (Dell 1555 Studio) graphics card(ATI 4570HD) has an issue due to which I cannot run it in full graphics mode. I tried replacing the thermal paste(using artic silver - https://www.amazon.co.uk/Arctic-Silver- … +silver+5). I think the fan is not able to cool or maybe the thermal sensor has a problem. Anyway I took this opportunity to throw Windows that was pre-installed in this device.

So now I am using the open source radeon driver with options to run in low power mode. I use the following.

echo balanced > /sys/class/drm/card0/device/power_dpm_state                                                                                                                                     
echo low > /sys/class/drm/card0/device/power_dpm_force_performance_level   

it also works with

echo performance > /sys/class/drm/card0/device/power_dpm_state                                                                                                                                     
echo low > /sys/class/drm/card0/device/power_dpm_force_performance_level   

Now I need to run this before the graphical mode is switched on, or else it will cause the system to switch off. I created the following unit file to start the script before it starts the graphical mode.

[Unit]                                                                                                                                                                                          
Description=Lower AMD Power profile                                                                                                                                                             
                                                                                                                                                                                                
[Service]
Type=simple
ExecStart=/home/fazil/Dropbox/Linux/radeon_power
RemainAfterExit=yes
User=root

[Install]
WantedBy=multi-user.target

Then I copied the unit file to /etc/systemd/system/radeon-power.service

After this I enabled the service using

sudo systemctl enable radeon-power.service

If I start this service using

[fazil@DellStudio ~]$ sudo systemctl status radeon-power.service
● radeon-power.service - Lower AMD Power profile
   Loaded: loaded (/etc/systemd/system/radeon-power.service; enabled; vendor preset: disabled)
   Active: active (exited) since Mon 2016-11-28 03:05:42 GMT; 16h ago
 Main PID: 724 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/radeon-power.service

Nov 28 03:05:42 DellStudio systemd[1]: Started Lower AMD Power profile.

But after reboot it shows the following error (i am going to just restart and update this post - forgot to keep that smile )
Updated at 28-Nov-2016 19:50

● radeon-power.service - Lower AMD Power profile
   Loaded: loaded (/etc/systemd/system/radeon-power.service; enabled; vendor preset: disabled)
   Active: active (exited) (Result: exit-code) since Mon 2016-11-28 19:45:04 GMT; 2min 1s ago
  Process: 349 ExecStart=/home/fazil/Dropbox/Linux/radeon_power (code=exited, status=1/FAILURE)
 Main PID: 349 (code=exited, status=1/FAILURE)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/radeon-power.service

Nov 28 19:45:04 DellStudio systemd[1]: Started Lower AMD Power profile.
Nov 28 19:45:04 DellStudio radeon_power[349]: /home/fazil/Dropbox/Linux/radeon_power: line 2: /sys/class/drm/card0/device/power_dpm_state: Permission denied
Nov 28 19:45:04 DellStudio radeon_power[349]: /home/fazil/Dropbox/Linux/radeon_power: line 3: /sys/class/drm/card0/device/power_dpm_force_performance_level: Permission denied
Nov 28 19:45:04 DellStudio systemd[1]: radeon-power.service: Main process exited, code=exited, status=1/FAILURE

I had similar issue in Fedora 24 due to the SE linux permissions. I ended up disabling it in Fedora. But could not find anything similar in Arch.

Last edited by fazillatheef (2016-11-28 21:38:50)

Offline

#2 2016-11-28 19:46:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Startup script help

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-11-28 19:51:36

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Startup script help

Can you also post the contents of your radeon_power script.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2016-11-28 19:56:57

fazillatheef
Member
Registered: 2015-05-24
Posts: 10

Re: [Solved] Startup script help

The radeon_power script contains the following. It was made executable using chmod +x. I also tried many versions like making the script owned by root using chown command and executable.

#!/bin/sh
echo balanced > /sys/class/drm/card0/device/power_dpm_state
echo low > /sys/class/drm/card0/device/power_dpm_force_performance_level

Offline

#5 2016-11-28 19:59:15

fazillatheef
Member
Registered: 2015-05-24
Posts: 10

Re: [Solved] Startup script help

jasonwryan wrote:

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code

Apologies. I have corrected my original post.

Offline

#6 2016-11-28 20:01:51

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [Solved] Startup script help

User=root is unnecessary, Type should be oneshot and if it needs to run before certain graphical things, you need to use Before=.

Offline

#7 2016-11-28 20:24:34

fazillatheef
Member
Registered: 2015-05-24
Posts: 10

Re: [Solved] Startup script help

Raynman wrote:

User=root is unnecessary, Type should be oneshot and if it needs to run before certain graphical things, you need to use Before=.

Should I replace Wanted with Before? I tried this. I got the following message.

The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.

Offline

#8 2016-11-28 20:57:38

fazillatheef
Member
Registered: 2015-05-24
Posts: 10

Re: [Solved] Startup script help

Now the error message has changed. The script is unable to find the file. I have run the script after boot manually and it was able to find the file. Looks like kernel is setting up the graphics driver after the script executes.

[fazil@DellStudio ~]$ journalctl -b |grep radeon
Nov 28 20:41:25 DellStudio radeon_power[323]: /home/fazil/Dropbox/Linux/radeon_power: line 2: /sys/class/drm/card0/device/power_dpm_state: No such file or directory
Nov 28 20:41:25 DellStudio radeon_power[323]: /home/fazil/Dropbox/Linux/radeon_power: line 3: /sys/class/drm/card0/device/power_dpm_force_performance_level: No such file or directory
Nov 28 20:41:25 DellStudio systemd[1]: radeon-power.service: Main process exited, code=exited, status=1/FAILURE
Nov 28 20:41:25 DellStudio systemd[1]: radeon-power.service: Unit entered failed state.
Nov 28 20:41:25 DellStudio systemd[1]: radeon-power.service: Failed with result 'exit-code'.
Nov 28 20:41:25 DellStudio kernel: [drm] radeon kernel modesetting enabled.
Nov 28 20:41:25 DellStudio kernel: fb: switching to radeondrmfb from VESA VGA
Nov 28 20:41:25 DellStudio kernel: radeon 0000:01:00.0: VRAM: 512M 0x0000000000000000 - 0x000000001FFFFFFF (512M used)
Nov 28 20:41:25 DellStudio kernel: radeon 0000:01:00.0: GTT: 1024M 0x0000000020000000 - 0x000000005FFFFFFF
Nov 28 20:41:25 DellStudio kernel: [drm] radeon: 512M of VRAM memory ready
Nov 28 20:41:25 DellStudio kernel: [drm] radeon: 1024M of GTT memory ready.
Nov 28 20:41:25 DellStudio kernel: [drm] radeon: dpm initialized
Nov 28 20:41:25 DellStudio kernel: radeon 0000:01:00.0: WB enabled
Nov 28 20:41:25 DellStudio kernel: radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000020000c00 and cpu addr 0xffff88022ebd3c00
Nov 28 20:41:25 DellStudio kernel: radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000020000c0c and cpu addr 0xffff88022ebd3c0c
Nov 28 20:41:25 DellStudio kernel: radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x000000000005c598 and cpu addr 0xffffc9000101c598
Nov 28 20:41:25 DellStudio kernel: radeon 0000:01:00.0: radeon: MSI limited to 32-bit
Nov 28 20:41:25 DellStudio kernel: radeon 0000:01:00.0: radeon: using MSI.
Nov 28 20:41:25 DellStudio kernel: [drm] radeon: irq initialized.
Nov 28 20:41:26 DellStudio kernel: [drm] radeon atom DIG backlight initialized
Nov 28 20:41:27 DellStudio kernel: fbcon: radeondrmfb (fb0) is primary device
Nov 28 20:41:28 DellStudio kernel: radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device
Nov 28 20:41:29 DellStudio kernel: [drm] Initialized radeon 2.46.0 20080528 for 0000:01:00.0 on minor 0
Nov 28 20:41:29 DellStudio systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:radeon_bl0...
Nov 28 20:41:29 DellStudio systemd[1]: Started Load/Save Screen Backlight Brightness of backlight:radeon_bl0.

Offline

#9 2016-11-28 21:19:13

fazillatheef
Member
Registered: 2015-05-24
Posts: 10

Re: [Solved] Startup script help

Tried the suggestion in https://wiki.archlinux.org/index.php/AT … figuration

[fazil@DellStudio ~]$ cat /etc/tmpfiles.d/radeon-pm.conf
w /sys/class/drm/card0/device/power_dpm_state - - - - balanced
w /sys/class/drm/card0/device/power_dpm_force_performance_level - - - - low

This is also not working. Not able to see any messages. I think it is due to the same problem.

https://wiki.archlinux.org/index.php/Sy … rary_files

Note: This method may not work to set options in /sys since the systemd-tmpfiles-setup service may run before the appropriate device modules is loaded. In this case you could check whether the module has a parameter for the option you want to set with modinfo module and set this option with a config file in /etc/modprobe.d. Otherwise you will have to write a udev rule to set the appropriate attribute as soon as the device appears.

Now going to try this

/etc/udev/rules.d/30-radeon-pm.rules
KERNEL=="card0", SUBSYSTEM=="drm", DRIVERS=="radeon", ATTR{device/power_dpm_state}="balanced", ATTR{device/power_dpm_force_performance_level}="low"

Last edited by fazillatheef (2016-11-28 21:19:50)

Offline

Board footer

Powered by FluxBB