Open ShashaankHari opened 3 years ago
Hey there, by the looks of it it can't find the right files to write the pwm state to. Are you using the amdgpu
driver (it would create these files when the driver is loaded in /sys/class/drm/card0/device/hwmon/hwmon*
)?
I've only tested this on standalone cards (Vega, 6800xt, 6900xt), since I don't have any laptops with AMD integrated gpus.
Hey there, by the looks of it it can't find the right files to write the pwm state to. Are you using the
amdgpu
driver (it would create these files when the driver is loaded in/sys/class/drm/card0/device/hwmon/hwmon*
)?I've only tested this on standalone cards (Vega, 6800xt, 6900xt), since I don't have any laptops with AMD integrated gpus.
the driver is loaded because i tested it using glmark2
and these are the files present in that directory
ls -a /sys/class/drm/card0/device/hwmon/hwmon3
drwxr-xr-x - root 11 Aug 09:18 .
drwxr-xr-x - root 11 Aug 08:59 ..
lrwxrwxrwx 0 root 11 Aug 09:19 device -> ../../../0000:04:00.0
drwxr-xr-x - root 11 Aug 09:19 power
lrwxrwxrwx 0 root 11 Aug 08:59 subsystem -> ../../../../../../class/hwmon
.r--r--r-- 4.1k root 11 Aug 09:19 freq1_input
.r--r--r-- 4.1k root 11 Aug 09:19 freq1_label
.r--r--r-- 4.1k root 11 Aug 09:19 in0_input
.r--r--r-- 4.1k root 11 Aug 09:19 in0_label
.r--r--r-- 4.1k root 11 Aug 09:19 in1_input
.r--r--r-- 4.1k root 11 Aug 09:19 in1_label
.r--r--r-- 4.1k root 11 Aug 09:19 name
.r--r--r-- 4.1k root 11 Aug 09:19 temp1_input
.r--r--r-- 4.1k root 11 Aug 09:19 temp1_label
.rw-r--r-- 4.1k root 11 Aug 09:19 uevent
It doesn't look like you have any of the pwm
files there which would usually allow controlling the fans.
Here's what it looks like on my system:
Something like lsmod |grep amdgpu
should let you see whats loaded in the kernel. I'm wondering if the integrated CPU/GPU's maybe use the CPU's PWM settings to control the fans.
You may just have to up your fan speeds on the CPU to get your cooling.
It doesn't look like you have any of the
pwm
files there which would usually allow controlling the fans.Here's what it looks like on my system:
Something like
lsmod |grep amdgpu
should let you see whats loaded in the kernel. I'm wondering if the integrated CPU/GPU's maybe use the CPU's PWM settings to control the fans.You may just have to up your fan speeds on the CPU to get your cooling.
how do i control cpu fans?
You probably need to look into lm-sensors
package / pwmconfig
: https://wiki.archlinux.org/title/fan_speed_control
I'll add a note to the README that this is only intended to work on non-integrated gpus.
I'm seeing the same error with a card that is not integrated.
steam@steam:~$ sudo systemctl status amdgpu-fan.service
● amdgpu-fan.service - Service for controling amdgpu fan.
Loaded: loaded (/etc/systemd/system/amdgpu-fan.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2022-01-24 16:47:15 CST; 215ms ago
Main PID: 5545 (amdgpu-fan)
Tasks: 4 (limit: 17832)
Memory: 14.7M
CPU: 422ms
CGroup: /system.slice/amdgpu-fan.service
└─5545 /usr/bin/python3 /usr/local/bin/amdgpu-fan
Jan 24 16:47:15 steam amdgpu-fan[5545]: sys.exit(main())
Jan 24 16:47:15 steam amdgpu-fan[5545]: File "/usr/local/lib/python3.9/dist-packages/amdgpu_fan/controller.py", line 78, in main
Jan 24 16:47:15 steam amdgpu-fan[5545]: FanController(config).main()
Jan 24 16:47:15 steam amdgpu-fan[5545]: File "/usr/local/lib/python3.9/dist-packages/amdgpu_fan/controller.py", line 35, in main
Jan 24 16:47:15 steam amdgpu-fan[5545]: logger.debug(f'{name}: Temp {temp}, Setting fan speed to: {speed}, fan speed{card.fan_speed}, min:{card.fan_min}, max:{card.fan_max}')
Jan 24 16:47:15 steam amdgpu-fan[5545]: File "/usr/local/lib/python3.9/dist-packages/amdgpu_fan/lib/amdgpu.py", line 64, in fan_min
Jan 24 16:47:15 steam amdgpu-fan[5545]: return int(self.read_endpoint('pwm1_min'))
Jan 24 16:47:15 steam amdgpu-fan[5545]: File "/usr/local/lib/python3.9/dist-packages/amdgpu_fan/lib/amdgpu.py", line 36, in read_endpoint
Jan 24 16:47:15 steam amdgpu-fan[5545]: with open(self._endpoints[endpoint], 'r') as e:
Jan 24 16:47:15 steam amdgpu-fan[5545]: KeyError: 'pwm1_min'
steam@steam:~$ sudo systemctl status amdgpu-fan.service
● amdgpu-fan.service - Service for controling amdgpu fan.
Loaded: loaded (/etc/systemd/system/amdgpu-fan.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2022-01-24 16:47:15 CST; 374ms ago
Process: 5545 ExecStart=/usr/local/bin/amdgpu-fan (code=exited, status=1/FAILURE)
Main PID: 5545 (code=exited, status=1/FAILURE)
CPU: 440ms
Additional info:
steam@steam:/sys/class/drm/card0/device/hwmon/hwmon0$ ls -lA
total 0
lrwxrwxrwx 1 root root 0 Jan 24 16:37 device -> ../../../0000:00:01.0
-r--r--r-- 1 root root 4096 Jan 24 16:52 freq1_input
-r--r--r-- 1 root root 4096 Jan 24 16:52 freq1_label
-r--r--r-- 1 root root 4096 Jan 24 16:37 in1_input
-r--r--r-- 1 root root 4096 Jan 24 16:37 in1_label
-r--r--r-- 1 root root 4096 Jan 24 16:37 name
drwxr-xr-x 2 root root 0 Jan 24 16:52 power
lrwxrwxrwx 1 root root 0 Jan 24 16:37 subsystem -> ../../../../../class/hwmon
-r--r--r-- 1 root root 4096 Jan 24 16:37 temp1_crit
-r--r--r-- 1 root root 4096 Jan 24 16:37 temp1_crit_hyst
-r--r--r-- 1 root root 4096 Jan 24 16:37 temp1_input
-r--r--r-- 1 root root 4096 Jan 24 16:37 temp1_label
-rw-r--r-- 1 root root 4096 Jan 24 16:37 uevent
steam@steam:/sys/class/drm/card0/device/hwmon/hwmon0$ cd power/
steam@steam:/sys/class/drm/card0/device/hwmon/hwmon0/power$ ls -lA
total 0
-rw-r--r-- 1 root root 4096 Jan 24 16:52 async
-rw-r--r-- 1 root root 4096 Jan 24 16:52 autosuspend_delay_ms
-rw-r--r-- 1 root root 4096 Jan 24 16:52 control
-r--r--r-- 1 root root 4096 Jan 24 16:52 runtime_active_kids
-r--r--r-- 1 root root 4096 Jan 24 16:52 runtime_active_time
-r--r--r-- 1 root root 4096 Jan 24 16:52 runtime_enabled
-r--r--r-- 1 root root 4096 Jan 24 16:52 runtime_status
-r--r--r-- 1 root root 4096 Jan 24 16:52 runtime_suspended_time
-r--r--r-- 1 root root 4096 Jan 24 16:52 runtime_usage
steam@steam:/sys/class/drm/card0/device/hwmon/hwmon0/power$ lsmod |grep amdgpu
amdgpu 7774208 15
gpu_sched 45056 1 amdgpu
i2c_algo_bit 16384 1 amdgpu
drm_ttm_helper 16384 1 amdgpu
ttm 81920 2 amdgpu,drm_ttm_helper
drm_kms_helper 307200 1 amdgpu
drm 634880 10 gpu_sched,drm_kms_helper,amdgpu,drm_ttm_helper,ttm
steam@steam:/sys/class/drm/card0/device/hwmon/hwmon0/power$ lspci -knn|grep Hawaii
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii XT / Grenada XT [Radeon R9 290X/390X] [1002:67b0]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii XT / Grenada XT [Radeon R9 290X/390X] [1002:0b00]
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii HDMI Audio [Radeon R9 290/290X / 390/390X] [1002:aac8]
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii HDMI Audio [Radeon R9 290/290X / 390/390X] [1002:aac8]
steam@steam:/sys/class/drm/card0/device/hwmon/hwmon0/power$
KeyError: 'pwm1_min'
This is the key part of the error, you don't have the right files present to be able to control the fans.
All this script does is send number values to the pwm controls, which you don't seem to have exposed in your /sysfs
Ended up installing fancontrol. Thanks regardless.
Hi, I am using garuda Linux (arch based, zen kernel), on Lenovo Ideapad S340 (AMD Ryzen 5 3500U, Radeon vega 8 Picasso) my pc heats up so much on Linux even in conservative mode where charging is paused at 60%, i tried installing this aur but this is the status, below is the error..
ON MANUAL MODE