tuxedocomputers/tuxedo-control-center

Missing values for iGPU - Frequency gauge on Dashboard using Kernel 6.6

gmircea opened this issue ยท 5 comments

OS: Manjaro Linux 6.6.8-2-MANJARO #1 SMP PREEMPT_DYNAMIC Thu Dec 21 16:21:45 UTC 2023 x86_64 GNU/Linux
Device: Tuxedo Pulse 15 Gen 2

Using Tuxedo Control Center 2.1.2, on the Dashboard, the Frequency gauge for the integrated graphics card is blurred out.
This happens when using Kernel 6.6 and it works OK on Kernel 6.1

I narrowed down the problem to this line

const devicePath = "/sys/class/drm/card0/device/";

The code assumes that the information can be read from the following sysfs location: /sys/class/drm/card0/device/
On Kernel 6.6 that path is not available, instead this one is available:

# cat /sys/class/drm/card1/device/pp_dpm_sclk  
0: 200Mhz  
1: 400Mhz *
2: 1900Mhz  
# cat /sys/class/drm/card0/device/pp_dpm_sclk  
cat: /sys/class/drm/card0/device/pp_dpm_sclk: No such file or directory

Hence the check amdProperties.max_freq.isAvailable() fails and the current frequency is not displayed:
https://github.com/tuxedocomputers/tuxedo-control-center/blob/f0ecab5f080ce6fea27a6caa6f6acc0ce1876b34/src/service-app/classes/GpuInfoWorker.ts#L136C32-L136C32

It seems that the simpledrm Kernel driver is loaded first, as card0, before amdgpu driver which in turn ends up as card1.
The same problem is described here:
azeam/powerupp#43

A possible workaround would be to add initcall_blacklist=simpledrm_platform_driver_init to the kernel parameters.
Source: https://bbs.archlinux.org/viewtopic.php?id=287936

@gmircea
thank you very much for the workaround, it actually works.

@tuxedoxt
One question: is it planned at some point to dynamically find out the path to the "correct" graphics card?

Hi,

in my case card0 doesn't work, I have to use card1.

cat /sys/class/drm/card1/gt_cur_freq_mhz

To solve the problem, don't you need to modify the file tuxedo-control-center/src/service-app/classes/GpuInfoWorker.ts to change the three lines as follows:

/sys/class/drm/card0/... to /sys/class/drm/card*/โ€ฆ?

One question: is it planned at some point to dynamically find out the path to the "correct" graphics card?

Yes, more flexible readout is in the works.