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

Add Support for the Intel Xe driver & HWMON power values #303

Merged
merged 6 commits into from
Aug 31, 2024

Conversation

Steve-Tech
Copy link
Contributor

Hi, this PR adds basic support for Intel's new Xe driver, it doesn't support GPU utilisation (the fdinfo is different) but all other features that were working for i915 now work for Xe (on an A770).

The added power fields from the HWMON patch were also implemented, but only power1_max is present on both i915 and Xe. Temperature, fans, etc. were never implemented by Intel in the HWMON patch.

Also, the memory clock speed attributes (mem_cur_freq_mhz & mem_max_freq_mhz) don't seem to exist (in either drivers), should they be removed?

Thanks,
Steve

@cyear
Copy link

cyear commented Jul 24, 2024

Hello, how can I see the temperature and power consumption?
image

const char *syspath;
nvtop_device_get_syspath(gpu_info->card_device, &syspath);
nvtop_device_new_from_syspath(&card_dev_copy, syspath);
nvtop_device *intel_dev_auto = gpu_info->driver == DRIVER_XE ? gpu_info->driver_device : gpu_info->card_device;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a patch to re-introduce the copy. The problem is that libsystemd and libudev may/will cache these values so we need to get create a new device and query the sysattr to get up-to-date values (see libsystemd implementation)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess calling sd_device_set_sysattr_value with NULL should also do the trick to clear the cache

@Syllo
Copy link
Owner

Syllo commented Jul 28, 2024

Thanks for your patch!

I've reintroduced the temporary devices to avoid cached queries from the libsystemd/libudev.
Your PCIe speed seemed wrong so I switched back the device to the card and not the driver (seems to be what works better for other drivers too). Does that show better PCIe speeds?

Could you please test with my changes?

@Steve-Tech
Copy link
Contributor Author

Hi @cyear,

Hello, how can I see the temperature and power consumption?

Temperature isn't exposed by the driver so it wouldn't be easy to show it, and power consumption doesn't seem to be supported on consumer cards; it does however measure total energy consumption in joules, which could possibly be converted into watts.

@Steve-Tech
Copy link
Contributor Author

Hi @Syllo,

Thanks for your patch!

No worries!

I've reintroduced the temporary devices to avoid cached queries from the libsystemd/libudev.

Cool thanks, I was confused why they were there.

Your PCIe speed seemed wrong so I switched back the device to the card and not the driver (seems to be what works better for other drivers too). Does that show better PCIe speeds?

Nah, there's a bug with the driver/card where it only reports PCIe x1, even though it does operate at the full bandwidth available. lspci also shows it as x1. By switching it back to the card it just states N/A as the PCIe speed, I was hoping the later cards would have this fixed, and show the correct speed.

Could you please test with my changes?

Apart from the PCIe speed, it works fine! While I'm booted with Xe again, I'll try and figure out the fdinfo hopefully in the next few hours.

It seems only memory usage is supported by the Xe driver.

```
drm-driver:     xe
drm-client-id:  67
drm-pdev:       0000:03:00.0
drm-total-system:       0
drm-shared-system:      0
drm-active-system:      0
drm-resident-system:    0
drm-purgeable-system:   0
drm-total-gtt:  20608 KiB
drm-shared-gtt: 0
drm-active-gtt: 0
drm-resident-gtt:       20608 KiB
drm-total-vram0:        407556 KiB
drm-shared-vram0:       56 MiB
drm-active-vram0:       0
drm-resident-vram0:     407556 KiB
drm-total-stolen:       0
drm-shared-stolen:      0
drm-active-stolen:      0
drm-resident-stolen:    0
```
@Syllo Syllo merged commit 1b2fb52 into Syllo:master Aug 31, 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

Successfully merging this pull request may close these issues.

3 participants