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

GPU information #2

Open
5 of 7 tasks
onkoe opened this issue Oct 18, 2024 · 2 comments
Open
5 of 7 tasks

GPU information #2

onkoe opened this issue Oct 18, 2024 · 2 comments

Comments

@onkoe
Copy link
Owner

onkoe commented Oct 18, 2024

It is surprisingly difficult to get a reasonable amount of identifying/status information from a GPU, especially across platforms.

First of all, most of the major graphics protocols don't provide this kind of info, except some easy parts, like vendor and model identifiers. Looking past these, Vulkan only provides small bits of info. For example, you can get a little peek into the VRAM count by checking a device's memory heap(s). However, this is fallible, and integrated GPUs seem to include system memory in this count.

As such, we can't really use a graphics API to get this information - we need to check manually for each GPu, for each platform.

Here are descriptions on doing just that...

Linux

NVIDIA

Per driver...

  • nvidia: NVML can check for card information. There's a great library for this here, nvml_wrapper.
  • nouveau: TODO.

AMD

  • amdgpu: The new driver, post-2015.
    • Grab VRAM info with the mem_info_vram_total file.
    • Core + memory clock: exposed via HWMON.
      • Read each file at /sys/class/hwmon/hwmonN/name and ensure it's a GPU, likely "drm". Make sure its driver is amdgpu, somehow.
      • Then read hwmon/hwmonN/freq1_input for the compute clock, and freq2_input for the memory clock.
  • radeon: Old driver. TODO, but not soon.

Others

Spare me

...I will work on these later.

@onkoe
Copy link
Owner Author

onkoe commented Oct 27, 2024

in general, ARM GPU support is looking difficult. on Raspberry Pi, you can parse vcgencmd, but even that has limited information.

consider talking with kernel maintainers to implement sysfs functionality for these drivers?

@onkoe
Copy link
Owner Author

onkoe commented Oct 27, 2024

also, research nouveau resources. how do other collectors do it?

onkoe added a commit that referenced this issue Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant