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

Fixed compatibility with older AMD/ATI cards when calling ADL2_Adapter_FrameMetrics_Caps #535

Merged
merged 5 commits into from
Sep 10, 2021
Merged

Conversation

javguit
Copy link
Contributor

@javguit javguit commented Sep 9, 2021

AtiDlxx.ADL2_Adapter_FrameMetrics_Caps is not present in older drivers, so calling it in Hardware/Gpu/AmdGpu.cs was throwing an exception preventing LHM to detect older cards. My proposed fix is to add a method in AtiDlxx.cs to check if a method is present in the DLL file and calling it in AmdGpu.cs before the actual method.
It can be used with any method, so in the future it would be wiser to use this instead of assuming that the method exists to ensure compatibility.

Added a function ADL_Method_Exists in Interop/AtiDlxx.cs to check if an entry point of a given method name exists.
Added a call to ADL_Method_Exists in Hardware/Gpu/AmdGpu.cs before calling AtiDlxx.ADL2_Adapter_FrameMetrics_Caps.

Issue: #529

Copy link
Collaborator

@PhyxionNL PhyxionNL left a comment

Choose a reason for hiding this comment

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

See comments.

LibreHardwareMonitorLib/Interop/AtiAdlxx.cs Outdated Show resolved Hide resolved
LibreHardwareMonitorLib/Hardware/Gpu/AmdGpu.cs Outdated Show resolved Hide resolved
@PhyxionNL PhyxionNL merged commit 0fd00e2 into LibreHardwareMonitor:master Sep 10, 2021
@javguit javguit deleted the AMD-ADL-method-exist-check branch September 10, 2021 19:35
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.

None yet

2 participants