Closed CarterLi closed 1 month ago
https://github.com/fastfetch-cli/fastfetch/commit/b3b6e5fec1ca845193366081ddda55331e7f99ca reworked AMD GPU detection code for Linux. It would be appreciated if someone can actually test it on host.
fastfetch -s gpu --format json --gpu-driver-specific --gpu-temp --gpu-detection-method auto --format json
I get the following with running CI version at 29ae56e :
[
{
"type": "GPU",
"result": [
{
"index": null,
"coreCount": null,
"coreUsage": null,
"memory": {
"dedicated": {
"total": null,
"used": null
},
"shared": {
"total": 536870912,
"used": 242167808
}
},
"driver": "amdgpu",
"name": "AMD Device 1636 (VGA compatible)",
"temperature": 37.0,
"type": "Integrated",
"vendor": "AMD",
"platformApi": "DRM (card1)",
"frequency": 0,
"deviceId": 4000
}
]
}
]
@howyay What GPU do you actually use?
Did you compile fastfetch yourself, or download it from Github Actions?
Downloaded from Github Action - its the integrated GPU on a 4700U, sorry if that's not what you were looking for! 😅
The problem is that the distro you use (NixOS) doesn't follow the standard linux directory so that fastfetch fails to load necessary libraries to make the change work.
But at least I know the fall back path works. It's still very helpful! Thanks.
I just compiled the dev branch, hth:
tim@betapictoris ❯ build-fastfetch/fastfetch -s gpu --format json --gpu-driver-specific --gpu-temp --gpu-detection-method auto --format json
_amdgpu_device_initialize: amdgpu_query_info(ACCEL_WORKING) failed (-13)
[
{
"type": "GPU",
"result": [
{
"index": null,
"coreCount": null,
"coreUsage": null,
"memory": {
"dedicated": {
"total": 17163091968,
"used": 540876800
},
"shared": {
"total": null,
"used": null
}
},
"driver": "amdgpu",
"name": "Radeon RX 7700 XT / 7800 XT",
"temperature": 23.0,
"type": "Discrete",
"vendor": "AMD",
"platformApi": "DRM (card1)",
"frequency": 0,
"deviceId": 48000
}
]
}
]
_amdgpu_device_initialize: amdgpu_query_info(ACCEL_WORKING) failed (-13)
Google said that you should make sure that you are in video
group
https://gitlab.freedesktop.org/drm/amd/-/issues/1993#note_1356967
I just checked and I am in the video group.
However, it works when running with sudo/doas:
tim@betapictoris ❯ doas build-fastfetch/fastfetch -s gpu --format json --gpu-driver-specific --gpu-temp --gpu-detection-method auto --format json
[
{
"type": "GPU",
"result": [
{
"index": 29822,
"coreCount": 3,
"coreUsage": 4.0,
"memory": {
"dedicated": {
"total": 16944787456,
"used": 575197184
},
"shared": {
"total": null,
"used": null
}
},
"driver": "amdgpu 3.58",
"name": "AMD Radeon RX 7800 XT",
"temperature": 23000.0,
"type": "Discrete",
"vendor": "AMD",
"platformApi": "DRM (card1)",
"frequency": 2213,
"deviceId": 48000
}
]
}
]
Thanks @TimB87
Can you pull the latest code and try again?
Also you may try the command without --format json
@CarterLi no problem!
I still get the same error though without doas:
❯ build-fastfetch/fastfetch -s gpu --format json --gpu-driver-specific --gpu-temp --gpu-detection-method auto
_amdgpu_device_initialize: amdgpu_query_info(ACCEL_WORKING) failed (-13)
[
{
"type": "GPU",
"result": [
{
"index": null,
"coreCount": null,
"coreUsage": null,
"memory": {
"dedicated": {
"total": 17163091968,
"used": 565047296
},
"shared": {
"total": null,
"used": null
}
},
"driver": "amdgpu",
"name": "Radeon RX 7700 XT / 7800 XT",
"temperature": 23.0,
"type": "Discrete",
"vendor": "AMD",
"platformApi": "DRM (card1)",
"frequency": 0,
"deviceId": 48000
}
]
}
]
I can't fix the permission issue. I fixed some bugs found in your previous post.
I am unsure what is missing as e.g. amdgpu_top works just fine.
I ran it through strace and it seems htis is the relevant part of it:
access("/dev/dri/card1", F_OK) = 0
ioctl(4, DRM_IOCTL_GET_CLIENT, 0x7ffd8db0e5f0) = 0
ioctl(4, DRM_IOCTL_VERSION, 0x559f1e691f40) = 0
ioctl(4, DRM_IOCTL_VERSION, 0x559f1e691f40) = 0
fcntl(4, F_DUPFD_CLOEXEC, 0) = 5
ioctl(5, DRM_IOCTL_AMDGPU_INFO or DRM_IOCTL_IVPU_SUBMIT, 0x7ffd8db0e560) = -1 EACCES (Permission denied)
write(2, "_amdgpu_device_initialize: amdgp"..., 73_amdgpu_device_initialize: amdgpu_query_info(ACCEL_WORKING) failed (-13)
) = 73
close(5) = 0
close(4) = 0
munmap(0x7fd8a9364000, 45712) = 0
munmap(0x7fd8a934d000, 93464) = 0
openat(AT_FDCWD, "/sys/class/drm/card1/device/hwmon/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
which poped up here: https://gitlab.freedesktop.org/mesa/drm/-/issues/52 Maybe that makes sense to you? I dunno.
btw: I am not a fastfetch user, I saw that ticket calling for testers by accident and thought I can help :-)
Thanks for your information. I think I should use render instead of card
Feel free to ping me if you want another test with it
Can you paste the result running fastfetch with sudo, so I can check if core count and temperature report meaningful values.
❯ doas build-fastfetch/fastfetch -s gpu --format json --gpu-driver-specific --gpu-temp --gpu-detection-method auto
[
{
"type": "GPU",
"result": [
{
"index": null,
"coreCount": 60,
"coreUsage": 5.0,
"memory": {
"dedicated": {
"total": 16935841792,
"used": 606416896
},
"shared": {
"total": null,
"used": null
}
},
"driver": "amdgpu 3.58",
"name": "AMD Radeon RX 7800 XT",
"temperature": 24.0,
"type": "Discrete",
"vendor": "AMD",
"platformApi": "DRM (card1)",
"frequency": 2213,
"deviceId": 48000
}
]
}
]
Thanks for your information. I think I should use render instead of card
Should be fixed in 5058a93
@TimB87 Can you test it again?
@CarterLi
❯ build-fastfetch/fastfetch -s gpu --format json --gpu-driver-specific --gpu-temp --gpu-detection-method auto
[
{
"type": "GPU",
"result": [
{
"index": null,
"coreCount": 60,
"coreUsage": 0.0,
"memory": {
"dedicated": {
"total": 16963362816,
"used": 191377408
},
"shared": {
"total": null,
"used": null
}
},
"driver": "amdgpu 3.58",
"name": "AMD Radeon RX 7800 XT",
"temperature": 23.0,
"type": "Discrete",
"vendor": "AMD",
"platformApi": "DRM (card1)",
"frequency": 2213,
"deviceId": 48000
}
]
}
]
Good!
https://gitlab.freedesktop.org/search?search=amdgpu_query_gpu_info&nav_source=navbar&project_id=177&group_id=1155&search_code=true&repository_ref=main