LenovoLegionToolkit
LenovoLegionToolkit copied to clipboard
[FEAT]: Create API for AMD GPUs
Rules
- [X] I made myself familiar with the README.
- [X] I checked closed issues for similar ones and did not find a similar feature request mentioned before.
- [X] I understand that, if insufficient information was provided, my issue will be closed without an answer.
Version
All
OS
All
Device
All Legions with AMD graphics
Is your feature request related to a problem?
Currently GPU specific features are not supported by LLT on AMD GPUs. It would be nice to change this. Features that need to be supported:
- [ ] Information whether the dGPU is active (powered on) or not.
- [ ] Information about dGPU power state.
- [ ] GPU current and maximum Core and Mem clocks.
- [ ] GPU current and maximum core temperature.
- [ ] Checking if monitor is attached to GPU.
- [ ] (Optional) ability to set core/mem frequency offset.
How would you like the problem to be solved?
Implement an API that is easy to use with C#.
What alternatives have you considered?
n/a
Additional information
n/a
https://stackoverflow.com/questions/51248679/how-to-get-gpu-load-in-percentage-and-gpu-temperature-on-amd-video-cards Can this article help you?
Would this help? It's documentation for using ADLX with C#: https://gpuopen.com/manuals/ADLX/adlx-page_sample_cs/
Status update:
I tried both the ADLX library and older ADL library, and either I am totally missing something or most stats are not reported.
I made two branches: spike/adlx
and spike/adl
where you can check some progress. ADLX is super annoying to use and ADL is now obsolete. It wouldn't be too weird except the new one, ADLX, doesn't support a lot of features yet.
Here are also two reports from LibreHardwareMonitor:
which seem to confirm that information like max clocks, max temp etc. are not reported.
Either I am completely missing something or AMD APIs are just really funky and weird. I also updated the issue, to better list required features to complete the implementation.
Any help is appreciated, but please stick to specific solutions, information or code samples, having above information in mind.
EDIT: I also cleaned up less relevant comments, to clean up the thread here, nothing personal.
Hello, you can use my implementation from G-Helper https://github.com/seerge/g-helper/blob/main/app/Gpu/AMD/AmdGpuControl.cs :) I mainly read only GPU temp and GPU load, but ADL2_New_QueryPMLogData_Get method reports bunch of other sensors that you can also use.
But it doesn't return everything needed. Verified with librehardwaremonitor.
@BartoszCichecki this is what I manage to get from my Radeon 6800S
I can imagine it could be different per device tho, but from your desired list it already has clocks, temps, load %, power usage (in watts)
You can check for monitors attached to GPU as well, but via different method.
7/20/2023 8:09:47 PM: PMLOG_CLK_GFXCLK:1495
7/20/2023 8:09:47 PM: PMLOG_CLK_MEMCLK:1342
7/20/2023 8:09:47 PM: PMLOG_TEMPERATURE_EDGE:58
7/20/2023 8:09:47 PM: PMLOG_FAN_RPM:3200
7/20/2023 8:09:47 PM: PMLOG_FAN_PERCENTAGE:48
7/20/2023 8:09:47 PM: PMLOG_INFO_ACTIVITY_GFX:96
7/20/2023 8:09:47 PM: PMLOG_INFO_ACTIVITY_MEM:18
7/20/2023 8:09:47 PM: PMLOG_GFX_VOLTAGE:750
7/20/2023 8:09:47 PM: PMLOG_ASIC_POWER:53
7/20/2023 8:09:47 PM: PMLOG_TEMPERATURE_HOTSPOT:63
7/20/2023 8:09:47 PM: PMLOG_SMART_POWERSHIFT_CPU:0
7/20/2023 8:09:47 PM: PMLOG_SMART_POWERSHIFT_DGPU:29
7/20/2023 8:09:47 PM: PMLOG_BUS_SPEED:3
7/20/2023 8:09:47 PM: PMLOG_BUS_LANES:8