Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request testing of AMD card users #816

Closed
yai-dev opened this issue Apr 28, 2024 · 30 comments
Closed

Request testing of AMD card users #816

yai-dev opened this issue Apr 28, 2024 · 30 comments
Labels
bug Something isn't working

Comments

@yai-dev
Copy link

yai-dev commented Apr 28, 2024

General description of bug:

  • What happened: I had 2 gpus on my laptop: AMD integrated GPU and NVIDIA 3060 Mobile (discrete gpu), fastfetch detected AMD as dGPU but no NVIDIA 3060 Mobile
  • What should happen: NVIDIA 3060 Mobile should be detected to dGPU but not AMD integrated GPU
  • Fastfetch version used: fastfetch 2.10.2-debug (x86_64)
  • Did it work in an older version: IDK
  • Where did you get the binary: ArchLinux Offcial Repository
  • Does this issue still occurs in the latest dev build?

Often helpful information:

Screenshot:
image

The content of the configuration file you use (if any):
There has no configuration file i used

Output of fastfetch --list-features:

threads
vulkan
wayland
xcb-randr
xcb
xrandr
x11
drm
gio
dconf
dbus
imagemagick7
chafa
zlib
xfconf
egl
glx
osmesa
opencl
libpulse
libnm
libddcutil
videodev2
Directx Headers
Proprietary GPU driver API
System yyjson
@yai-dev yai-dev added the bug Something isn't working label Apr 28, 2024
@yai-dev
Copy link
Author

yai-dev commented Apr 28, 2024

FYI: when i run fastfetch with flag --gpu-force-vulkan, outputs is correct:

image

@yai-dev
Copy link
Author

yai-dev commented Apr 28, 2024

I think is these codes cause wrong detection:

gpu->type = size > 1024UL * 1024 * 1024 ? FF_GPU_TYPE_DISCRETE : FF_GPU_TYPE_INTEGRATED;

@CarterLi
Copy link
Member

I actually don't have an AMD GPU. Can you paste the result of following command here?

cat /sys/class/drm/card{0,1,2}/device/{mem_info_vram_total,mem_info_vram_used,mem_info_vis_vram_total,mem_info_vis_vram_used,mem_info_gtt_total,mem_info_gtt_used,smartshift_apu_power,smartshift_dgpu_power,smartshift_bias}

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

I actually don't have an AMD GPU. Can you paste the result of following command here?

cat /sys/class/drm/card{0,1,2}/device/{mem_info_vram_total,mem_info_vram_used,mem_info_vis_vram_total,mem_info_vis_vram_used,mem_info_gtt_total,mem_info_gtt_used,smartshift_apu_power,smartshift_dgpu_power,smartshift_bias}

Here is what you need:

4294967296
1009135616
4294967296
1009135616
31523540992
201281536

CarterLi added a commit that referenced this issue Apr 29, 2024
@CarterLi
Copy link
Member

Seems no one can be used to identify the GPU type.

Let's disable the GPU type detection

@CarterLi
Copy link
Member

CarterLi commented Apr 29, 2024

hwmon interface seems contain interesting data. Notably

  • Northbridge voltage (APUs only)
  • GPU memory clock (dGPU only)

https://www.kernel.org/doc/html/v5.10/gpu/amdgpu.html#hwmon-interfaces

What do ls -l /sys/class/drm/card?/device/hwmon/hwmon?/{freq1_input, in1_input} and cat /sys/class/drm/card?/device/hwmon?/{freq1_input, in1_input} print?

@CarterLi CarterLi changed the title [BUG] Wrong GPU type detection Request testing of AMD card users Apr 29, 2024
@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

hwmon interface seems contain interesting data. Notably

  • Northbridge voltage (APUs only)
  • GPU memory clock (dGPU only)

https://www.kernel.org/doc/html/v5.10/gpu/amdgpu.html#hwmon-interfaces

What do ls -l /sys/class/drm/card?/device/hwmon/hwmon?/{freq1_input, in1_input} and cat /sys/class/drm/card?/device/hwmon?/{freq1_input, in1_input} print?

FYI:

Output for ls -l /sys/class/drm/card0/device/hwmon/hwmon2/freq1_input


.r--r--r-- 4.1k root 29 4月  15:01 /sys/class/drm/card0/device/hwmon/hwmon2/freq1_input

Output for ls -l /sys/class/drm/card0/device/hwmon/hwmon2/in1_input


.r--r--r-- 4.1k root 29 4月  15:01 /sys/class/drm/card0/device/hwmon/hwmon2/in1_input

Output for cat /sys/class/drm/card0/device/hwmon/hwmon2/freq1_input


400000000

Output for cat /sys/class/drm/card0/device/hwmon/hwmon2/in1_input


943

It seems card1 doesn't has files or symlinks as you said but only card0 (a.k.a amdgpu)

@CarterLi
Copy link
Member

CarterLi commented Apr 29, 2024

I'm sorry. It should be cat /sys/class/drm/card0/device/hwmon/hwmon2/freq2_input

And what does ls -l /sys/class/drm/card0/device/hwmon/hwmon? print?

It seems card1 doesn't has files or symlinks as you said but only card0 (a.k.a amdgpu)

It was expected. All these files are amdgpu only

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

I'm sorry. It should be cat /sys/class/drm/card0/device/hwmon/hwmon2/freq2_input

And what does ls -l /sys/class/drm/card0/device/hwmon/hwmon? print?

It seems card1 doesn't has files or symlinks as you said but only card0 (a.k.a amdgpu)

It was expected. All these files are amdgpu only

FYI:

Output for ls -l /sys/class/drm/card0/device/hwmon/hwmon?:

lrwxrwxrwx 1 root root    0  4月29日 15:01 device -> ../../../0000:05:00.0
-r--r--r-- 1 root root 4096  4月29日 15:01 freq1_input
-r--r--r-- 1 root root 4096  4月29日 15:01 freq1_label
-r--r--r-- 1 root root 4096  4月29日 15:01 in0_input
-r--r--r-- 1 root root 4096  4月29日 15:01 in0_label
-r--r--r-- 1 root root 4096  4月29日 15:01 in1_input
-r--r--r-- 1 root root 4096  4月29日 15:01 in1_label
-r--r--r-- 1 root root 4096  4月29日 15:01 name
drwxr-xr-x 2 root root    0  4月29日 09:57 power
-r--r--r-- 1 root root 4096  4月29日 15:01 power1_input
-r--r--r-- 1 root root 4096  4月29日 15:01 power1_label
lrwxrwxrwx 1 root root    0  4月29日 09:57 subsystem -> ../../../../../../class/hwmon
-r--r--r-- 1 root root 4096  4月29日 15:01 temp1_input
-r--r--r-- 1 root root 4096  4月29日 15:01 temp1_label
-rw-r--r-- 1 root root 4096  4月29日 09:57 uevent

Output for cat /sys/class/drm/card0/device/hwmon/hwmon2/freq2_input:

NO SUCH FILE OR DIRECTORY

@CarterLi
Copy link
Member

I have implemented a version. It should correctly detect the GPU type of your AMD iGPU and NV dGPU. It should also print the GPU frequency for the AMD iGPU (in your case, 0.4GHz should be printed)

https://github.com/fastfetch-cli/fastfetch/actions/runs/8878225530/artifacts/1456489814

@CarterLi
Copy link
Member

Output for cat /sys/class/drm/card0/device/hwmon/hwmon2/freq2_input:
NO SUCH FILE OR DIRECTORY

Cool!

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

I have implemented a version. It should correctly detect the GPU type of your AMD iGPU and NV dGPU. It should also print the GPU frequency for the AMD iGPU (in your case, 0.4GHz should be printed)

cool, i will test it.

@CarterLi
Copy link
Member

CarterLi commented Apr 29, 2024

If you specify --gpu-driver-specific --gpu-temp, fastfetch should print more information for both iGPU and dGPU.

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

image

seems not working, emmm

@CarterLi
Copy link
Member

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

https://github.com/fastfetch-cli/fastfetch/actions/runs/8878546945/artifacts/1456557467

This one please.

image

It seems working right now, cool.

@CarterLi
Copy link
Member

CarterLi commented Apr 29, 2024

GPU temp didn't work? What does /sys/class/drm/card0/device/hwmon/hwmon?/temp1_input print?

My mistake

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

GPU temp didn't work? What does /sys/class/drm/card0/device/hwmon/hwmon?/temp1_input print?

My mistake

haha, dont mind, your fixing is freking fast.

@CarterLi
Copy link
Member

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

@CarterLi
Copy link
Member

Does GPU temp work with --gpu-temp?

@CarterLi
Copy link
Member

AMD driver only reports current GPU frequency, while fastfetch reports max frequency for both CPU and non-AMD GPUs. I wonder if I should remove it.

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

AMD driver only reports current GPU frequency, while fastfetch reports max frequency for both CPU and non-AMD GPUs. I wonder if I should remove it.

image

AMD driver only reports current GPU frequency, while fastfetch reports max frequency for both CPU and non-AMD GPUs. I wonder if I should remove it.

keep it if someone need it, if the freq is correct.

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

@CarterLi i think i need to test new gpu detection is working on Wayland, wait plz

@CarterLi
Copy link
Member

What does /sys/class/drm/card0/device/uevent print?

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

@CarterLi i think i need to test new gpu detection is working on Wayland, wait plz

image

image

image

seems to working on Wayland.

What does /sys/class/drm/card0/device/uevent print?

image

@CarterLi
Copy link
Member

What about /sys/class/drm/card0/device/revision

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

What about /sys/class/drm/card0/device/revision

FYI:

image

@yai-dev
Copy link
Author

yai-dev commented Apr 29, 2024

card1 if you needed:

image

@CarterLi
Copy link
Member

I think it's enough to close this issue. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants