Not able to execute this command: sudo echo balanced > /sys/class/drm/card0/device/power_dpm_state

Try a different kernel? :rofl:

Try a standard kernel, e.g. linux or linux-lts.

1 Like
                  __,,,,,,,_                         [email protected] 
            _╓╗╣╫╠╠╠╠╠╠╠╠╠╠╠╠╠╕╗╗┐_                  ------------------------------ 
         β•₯β•’β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•₯,               OS: Garuda Linux x86_64 
       β•—β• β• β• β• β• β• β• β•β•œβ•œβ•œβ•œβ•β•’β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β”             Host: Inspiron 15-3567 
      β•£β• β• β• β• β• β• β• β• β•’β•£β•’β•—β•• , `"β•˜β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•”β•₯_          Kernel: 5.13.13-arch1-1 
    β•’β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β••β•™β•₯β•₯β•œ   `"β•œβ• β•¬β• β• β• β• β• β• β• β• β• β• β• β•₯,       Uptime: 4 mins 
    β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•—β•₯β•₯β•₯β•₯╗╗╬╠╠╠╠╠╠╠╝╙╠╠╣╠╠╠╠╒┐     Packages: 1515 (pacman), 9 (flatpak), 9 (snap) 
   β•£β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•₯╬╣╠╠╠╠╠╠╠╠╗    Shell: zsh 5.8 
  β•’β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•—   Resolution: 1366x768 
  β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•    DE: Plasma 5.22.5 
  ╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╬     ```"β•œβ•β•’β• β• β•‘   WM: KWin 
 β•’β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•£,         β•˜β• β•ͺ    WM Theme: Lightly 
 β•žβ• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•’β”        β•œ     Theme: Breeze Dark [Plasma], Dracula [GTK3] 
 `β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•—             Icons: Fluent-dark [Plasma], Fluent-dark [GTK2/3] 
 ,╬╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠"β••            Terminal: konsole 
 β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β• β•—              Terminal Font: Roboto Mono [GOOG] 10 
 ╝^╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╝╣╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠║              CPU: Intel i5-7200U (4) @ 3.100GHz 
  β•”β•œ`β•žβ”˜β•’β•›β•œ β•‘β•’β• "β•šβ• β• β•œβ•β”Œβ•žβ•ž"β•’β• β• β• β• β• β• β• β• β• β• β•£β•©β•’β•ͺ              GPU: AMD ATI Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile 
     β•œβ•’"   `β•œ    `      β•œβ•™β••  β””β•£β• β• β• β• β•• β•žβ•™β•–             GPU: Intel HD Graphics 620 
                                β• β• β•                   Memory: 1511MiB / 11710MiB 
                                 β•œ
                                                                             
                                                                             



 ╭─[email protected] in ~ 
 ╰─λ sudo -i
[sudo] password for austin:      
[[email protected] ~]# sudo mv power_dpm_state /sys/class/drm/card0/device/
mv: cannot create regular file '/sys/class/drm/card0/device/power_dpm_state': Permission denied
[[email protected] ~]#  mv power_dpm_state /sys/class/drm/card0/device/
mv: cannot create regular file '/sys/class/drm/card0/device/power_dpm_state': Permission denied
[[email protected] ~]# cd /sys/class/drm/card0/device/
[[email protected] device]# echo balanced > power_dpm_state
-bash: power_dpm_state: Permission denied
[[email protected] device]#

But the /sys directory does show up in Dolphin

Thank you

It shows up, but does it contain anything?

The /sys dir was there in the Dolphin already, but the contents didn't show up,
bu now after installing linux, all the contents show up!

But apparently I just rechecked now and found it empty in Dolphin empty,
it seems that after just boot the contents are visible, but after some time they vanish away in the dolphin,
And same is with linux-cacule !
But still I can't do anything in that dir even with root permissions?

/sys is the kernel's settings domain. you can't create files or directories there, even as root, because there aren't files and directories there - just the kernel.

Seems you're trying to adjust performance for your discreet GPU. That would likely be card1, not card0. If there's no 'file' for power_dpm_state, then the driver doesn't have that setting. I have an AMD Vega 54 and it does not have a power_dpm_state setting (because it's not a mobile variant, I imagine), for instance.

Wish I could explain Dolphin's behavior. That's just weird.

5 Likes

Thank you @Catra for the explanation.
But actually, I suggested to try this out by someone who had the same GPU and was running Arch: https://www.reddit.com/r/archlinux/comments/pelxaw/amdgpu_driver_issue/hbjn6po/?context=3

Thank You

You can't sudo echo.
Either enter in su and echo without sudo, or use echo and pipe it to sudo tee.

echo balanced | sudo tee /sys/class/drm/card0/device/power_dpm_state
3 Likes
╰─λ echo balanced | sudo tee /sys/class/drm/card0/device/power_dpm_state
tee: /sys/class/drm/card0/device/power_dpm_state: Permission denied
balanced

 ╭─[email protected] in ~ took 2s
[πŸ”΄] Γ— su
Password: 
[[email protected] austin]# echo balanced | sudo tee /sys/class/drm/card0/device/power_dpm_state
tee: /sys/class/drm/card0/device/power_dpm_state: Permission denied
balanced
[[email protected] austin]# echo balanced > /sys/class/drm/card0/device/power_dpm_state
bash: /sys/class/drm/card0/device/power_dpm_state: Permission denied
[[email protected] austin]#

Thanks, @petsam but, still didn't work,
maybe I will try posting at the arch linux reddit

Check file permissions include w.

ls -l <sys-folder>
 ╰─λ ls -l /sys
drwxr-xr-x - root  6 Sep 10:06 ο„• block
drwxr-xr-x - root  6 Sep 10:06 ο„• bus
drwxr-xr-x - root  6 Sep 10:06 ο„• class
drwxr-xr-x - root  6 Sep 10:06 ο„• dev
drwxr-xr-x - root  6 Sep 10:06 ο„• devices
drwxr-xr-x - root  6 Sep 10:06 ο„• firmware
drwxr-xr-x - root  6 Sep 10:06 ο„• fs
drwxr-xr-x - root  6 Sep 10:06 ο„• kernel
drwxr-xr-x - root  6 Sep 10:06 ο„• module
drwxr-xr-x - root  6 Sep 10:06 ο„• power

 ╭─[email protected] in ~ took 4ms
 ╰─λ ls -l /sys/class/drm/card0/
drwxr-xr-x    - root  6 Sep 03:24 ο„• card0-eDP-1
drwxr-xr-x    - root  6 Sep 03:24 ο„• card0-HDMI-A-1
lrwxrwxrwx    0 root  6 Sep 08:54 ο„• device -> ../../../0000:00:02.0
drwxr-xr-x    - root  6 Sep 10:07 ο„• engine
drwxr-xr-x    - root  6 Sep 08:54 ο„• metrics
drwxr-xr-x    - root  6 Sep 10:07 ο„• power
lrwxrwxrwx    0 root  6 Sep 03:25 ο„• subsystem -> ../../../../../class/drm
.r--r--r-- 4.1k root  6 Sep 10:07 ο€– dev
.rw-------    0 root  6 Sep 10:07 ο€– error
.r--r--r-- 4.1k root  6 Sep 10:07 ο€– gt_act_freq_mhz
.rw-r--r-- 4.1k root  6 Sep 10:07 ο€– gt_boost_freq_mhz
.r--r--r-- 4.1k root  6 Sep 10:07 ο€– gt_cur_freq_mhz
.rw-r--r-- 4.1k root  6 Sep 08:54 ο€– gt_max_freq_mhz
.rw-r--r-- 4.1k root  6 Sep 08:54 ο€– gt_min_freq_mhz
.r--r--r-- 4.1k root  6 Sep 10:07 ο€– gt_RP0_freq_mhz
.r--r--r-- 4.1k root  6 Sep 10:07 ο€– gt_RP1_freq_mhz
.r--r--r-- 4.1k root  6 Sep 10:07 ο€– gt_RPn_freq_mhz
.rw-r--r-- 4.1k root  6 Sep 03

lrwxrwxrwx 0 root 6 Sep 08:54 ο„• device -> ../../../0000:00:02.0

w is there

This doesn't count. It's a symlink.

Read The Flying Manual, on what you want to do.

1 Like

Also take reddid posts with a pinch of salt

So so sorry @Catra, I just missed the card1,
yes, it has the power_dpm_state file whereas card0 doesn't.

Still figuring it out, but now instead of permission denied, it's showing Invalid argument,

 ╰─λ cd /sys/class/drm/card1/device/

 ╭─[email protected] in /sys/class/drm/card1/deviceπŸ”’ took 12ms
 ╰─λ sudo su
[[email protected] 0000:01:00.0]# pwd
/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0
[[email protected] 0000:01:00.0]# ls -a
.                         device            i2c-13              mem_info_gtt_used        power_dpm_force_performance_level  product_name    subsystem
..                        dma_mask_bits     i2c-14              mem_info_preempt_used    power_dpm_state                    product_number  subsystem_device
aer_dev_correctable       driver            i2c-7               mem_info_vis_vram_total  power_state                        remove          subsystem_vendor
aer_dev_fatal             driver_override   i2c-8               mem_info_vis_vram_used   pp_cur_state                       rescan          thermal_throttling_logging
aer_dev_nonfatal          drm               i2c-9               mem_info_vram_total      pp_dpm_mclk                        reset           uevent
ari_enabled               enable            irq                 mem_info_vram_used       pp_dpm_pcie                        resource        vbios_version
broken_parity_status      firmware_node     link                mem_info_vram_vendor     pp_dpm_sclk                        resource0       vendor
class                     fw_version        local_cpulist       modalias                 pp_force_state                     resource0_wc
config                    gpu_busy_percent  local_cpus          msi_bus                  pp_mclk_od                         resource2
consistent_dma_mask_bits  hwmon             max_link_speed      msi_irqs                 pp_num_states                      resource4
current_link_speed        i2c-10            max_link_width      pcie_bw                  pp_power_profile_mode              revision
current_link_width        i2c-11            mem_busy_percent    pcie_replay_count        pp_sclk_od                         rom
d3cold_allowed            i2c-12            mem_info_gtt_total  power                    pp_table                           serial_number
[[email protected] 0000:01:00.0]# sudo bash -c 'echo balanced > power_dpm_state'
bash: line 1: echo: write error: Invalid argument
[[email protected] 0000:01:00.0]# bash -c 'echo balanced > power_dpm_state'
bash: line 1: echo: write error: Invalid argument
[[email protected] 0000:01:00.0]# echo balanced > power_dpm_state
bash: echo: write error: Invalid argument
[[email protected] 0000:01:00.0]# sudo !!
sudo echo balanced > power_dpm_state
echo: write error: Invalid argument
[[email protected] 0000:01:00.0]# sudo echo battery > power_dpm_state
echo: write error: Invalid argument
[[email protected] 0000:01:00.0]# sudo echo battery > power_dpm_state

Here's my progress at Reddit: https://www.reddit.com/r/linuxquestions/comments/pld5xi/not_able_to_execute_this_command_sudo_echo/

Why don't you try with the other solution suggested in

with power_dpm_force_performance_level and relevant arguments?

3 Likes

Thanks, @filo, I think I just solved my issue, I would be posting details shortly maybe later in the evening.

1 Like

Now I have a good understanding and a solution to this problem:

The first mistake was, I had disabled DPM, which turns out to be an inappropriate solution for this :point_down:

  • (The setting for power_dpm_state shows up only after enabling DPM,
    which I did by changing the above value to amdgpu.dpm=1)

Secondly I was searching for the setting at the wrong place.
I was searching in /sys/class/drm/card0/device/ which turned out to be my integrated Intel card
(The Kernel identifies the GPU cards as card0, card1....)

My discrete AMD GPU turned out to be identified as card1

As you can have a look here, this directory has the setting power_dpm_state which I was looking for:

─λ cd /sys/class/drm/card1/device/

 ╭─[email protected] in /sys/class/drm/card1/deviceπŸ”’ took 33ms
 ╰─λ ls
lrwxrwxrwx    0 root 12 Sep 17:53 ο„• driver -> ../../../../bus/pci/drivers/amdgpu
drwxr-xr-x    - root 12 Sep 17:53 ο„• drm
lrwxrwxrwx    0 root 12 Sep 17:53 ο„• firmware_node -> ../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/device:1d
drwxr-xr-x    - root 13 Sep 08:59 ο„• fw_version
drwxr-xr-x    - root 12 Sep 17:53 ο„• hwmon
drwxr-xr-x    - root 12 Sep 17:53 ο„• i2c-7
drwxr-xr-x    - root 12 Sep 17:53 ο„• i2c-8
drwxr-xr-x    - root 12 Sep 17:53 ο„• i2c-9
drwxr-xr-x    - root 12 Sep 17:53 ο„• i2c-10
drwxr-xr-x    - root 12 Sep 17:53 ο„• i2c-11
drwxr-xr-x    - root 12 Sep 17:53 ο„• i2c-12
drwxr-xr-x    - root 12 Sep 17:53 ο„• i2c-13
drwxr-xr-x    - root 12 Sep 17:53 ο„• i2c-14
drwxr-xr-x    - root 12 Sep 17:53 ο„• link
drwxr-xr-x    - root 12 Sep 23:20 ο„• msi_irqs
drwxr-xr-x    - root 12 Sep 17:53 ο„• power
lrwxrwxrwx    0 root 12 Sep 23:23 ο„• subsystem -> ../../../../bus/pci
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– aer_dev_correctable
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– aer_dev_fatal
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– aer_dev_nonfatal
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– ari_enabled
.rw-r--r-- 4.1k root 12 Sep 17:53 ο€– broken_parity_status
.r--r--r-- 4.1k root 12 Sep 23:23 ο€– class
.rw-r--r-- 4.1k root 12 Sep 17:53 ξ—Ό config
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– consistent_dma_mask_bits
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– current_link_speed
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– current_link_width
.rw-r--r-- 4.1k root 12 Sep 17:53 ο€– d3cold_allowed
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– device
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– dma_mask_bits
.rw-r--r-- 4.1k root 12 Sep 17:53 ο€– driver_override
.rw-r--r-- 4.1k root 12 Sep 17:53 ο€– enable
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– gpu_busy_percent
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– irq
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– local_cpulist
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– local_cpus
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– max_link_speed
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– max_link_width
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– mem_busy_percent
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– mem_info_gtt_total
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– mem_info_gtt_used
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– mem_info_preempt_used
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– mem_info_vis_vram_total
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– mem_info_vis_vram_used
.r--r--r-- 4.1k root 12 Sep 23:25 ο€– mem_info_vram_total
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– mem_info_vram_used
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– mem_info_vram_vendor
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– modalias
.rw-r--r-- 4.1k root 12 Sep 17:53 ο€– msi_bus
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– pcie_bw
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– pcie_replay_count
.rw-r--r-- 4.1k root 12 Sep 23:26 ο€– power_dpm_force_performance_level
.rw-r--r-- 4.1k root 12 Sep 17:53 ο€– power_dpm_state
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– power_state
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– pp_cur_state
.rw-r--r-- 4.1k root 12 Sep 23:25 ο€– pp_dpm_mclk
.rw-r--r-- 4.1k root 13 Sep 08:59 ο€– pp_dpm_pcie
.rw-r--r-- 4.1k root 12 Sep 23:25 ο€– pp_dpm_sclk
.rw-r--r-- 4.1k root 13 Sep 08:59 ο€– pp_force_state
.rw-r--r-- 4.1k root 13 Sep 08:59 ο€– pp_mclk_od
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– pp_num_states
.rw-r--r-- 4.1k root 12 Sep 23:25 ο€– pp_power_profile_mode
.rw-r--r-- 4.1k root 13 Sep 08:59 ο€– pp_sclk_od
.rw-r--r-- 4.1k root 13 Sep 08:59 ο€– pp_table
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– product_name
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– product_number
.-w--w---- 4.1k root 12 Sep 17:53 ο€– remove
.-w------- 4.1k root 12 Sep 17:53 ο€– rescan
.-w------- 4.1k root 12 Sep 17:53 ο€– reset
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– resource
.rw------- 268M root 12 Sep 17:53 ο€– resource0
.rw------- 268M root 12 Sep 17:53 ο€– resource0_wc
.rw------- 262k root 12 Sep 17:53 ο€– resource2
.rw-------  256 root 12 Sep 17:53 ο€– resource4
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– revision
.rw------- 131k root 12 Sep 17:53 ο€– rom
.r--r--r-- 4.1k root 13 Sep 08:59 ο€– serial_number
.r--r--r-- 4.1k root 12 Sep 17:53 ο€– subsystem_device
.r--r--r-- 4.1k root 12 Sep 23:20 ο€– subsystem_vendor
.rw-r--r-- 4.1k root 13 Sep 08:59 ο€– thermal_throttling_logging
.rw-r--r-- 4.1k root 12 Sep 23:23 ο€– uevent
.r--r--r-- 4.1k root 12 Sep 23:25 ο€– vbios_version
.r--r--r-- 4.1k root 12 Sep 23:23 ο€– vendor

You can find several settings here, which enables us to control and monitor the GPU directly by changing the values (AMDGPU - ArchWiki)
These changes to the settings apply only for the current session and change back to the default values after a reboot.
This directory is like the Radeon software in Windows

These settings can accept only valid arguments.
(in my case I am trying to change power_dpm_state)

power_dpm_state it accepts only
battery or balanced(default value) or performance as valid arguments

But balanced didn't do the work as to my needs so I changed it to battery

As you change the arguments in these settings you can instantly see the changes reflect in the GPU's performance i.e. some changes in its clock speeds etc.

corectrl which we all might be familiar of does the same thing through a GUI (Changes the same settings in the /sys/class/drm/card1/device/ directory)

Since the settings change to the default values after boot, but I wanted power_dpm_state to retain the battery mode.
I found a solution to that too - UDEV rules :--
(AMDGPU - ArchWiki)

In my case :point_down:

 GNU nano 5.8                                                      /etc/udev/rules.d/30-amdgpu-pm.rules                                                                
KERNEL=="card1", SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_state}="battery"

For more details: https://www.reddit.com/r/linuxquestions/comments/pld5xi/not_able_to_execute_this_command_sudo_echo/hcjfs7j/?context=3

That's it, I hope I have explained everything clearly and in simple terms.
Thank you

3 Likes

@filo, It would be great if you reopened this post: 'amdgpu' driver issue / GPU crashes on reaching >400MHz core clock speeds - #7

Now I have an explanation and a better answer to the above post

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.