Skip to content

Commit 8afd593

Browse files
committed
Added the AMD GPU driver version to the report. Added a check for erroneous ActivityPercent values returned by the ADL_Overdrive5_CurrentActivity_Get method.
1 parent 2019791 commit 8afd593

4 files changed

Lines changed: 45 additions & 4 deletions

File tree

Hardware/ATI/ADL.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ internal struct ADLODNPerformanceStatus {
131131
public int VDDCI;
132132
}
133133

134+
[StructLayout(LayoutKind.Sequential)]
135+
internal struct ADLVersionsInfo {
136+
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
137+
public string DriverVersion;
138+
139+
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
140+
public string CatalystVersion;
141+
142+
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
143+
public string CatalystWebLink;
144+
}
145+
134146
internal enum ADLODNCurrentPowerType {
135147
TOTAL_POWER = 0,
136148
PPT_POWER,
@@ -357,6 +369,8 @@ public delegate ADLStatus ADL_Overdrive5_ODParameters_GetDelegate(
357369
public delegate ADLStatus ADL2_OverdriveN_PerformanceStatus_GetDelegate(
358370
IntPtr context, int adapterIndex,
359371
out ADLODNPerformanceStatus performanceStatus);
372+
public delegate ADLStatus ADL_Graphics_Versions_GetDelegate(
373+
out ADLVersionsInfo versionInfo);
360374

361375
private static ADL_Main_Control_CreateDelegate
362376
_ADL_Main_Control_Create;
@@ -401,6 +415,8 @@ public static ADL_Overdrive5_ODParameters_GetDelegate
401415
ADL_Overdrive5_ODParameters_Get;
402416
public static ADL2_OverdriveN_PerformanceStatus_GetDelegate
403417
ADL2_OverdriveN_PerformanceStatus_Get;
418+
public static ADL_Graphics_Versions_GetDelegate
419+
ADL_Graphics_Versions_Get;
404420

405421
private static string dllName;
406422

@@ -463,6 +479,8 @@ private static void CreateDelegates(string name) {
463479
out ADL_Overdrive5_ODParameters_Get);
464480
GetDelegate("ADL2_OverdriveN_PerformanceStatus_Get",
465481
out ADL2_OverdriveN_PerformanceStatus_Get);
482+
GetDelegate("ADL_Graphics_Versions_Get",
483+
out ADL_Graphics_Versions_Get);
466484
}
467485

468486
static ADL() {

Hardware/ATI/ATIGPU.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,12 @@ public override void Update() {
563563
coreVoltage.Value = null;
564564
}
565565

566-
coreLoad.Value = Math.Min(adlp.ActivityPercent, 100);
567-
ActivateSensor(coreLoad);
566+
if (adlp.ActivityPercent >= 0 && adlp.ActivityPercent <= 100) {
567+
coreLoad.Value = adlp.ActivityPercent;
568+
ActivateSensor(coreLoad);
569+
} else {
570+
coreLoad.Value = null;
571+
}
568572
} else {
569573
coreClock.Value = null;
570574
memoryClock.Value = null;

Hardware/ATI/ATIGroup.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ public ATIGroup(ISettings settings) {
3434
report.AppendLine(adl2Status.ToString());
3535
report.AppendLine();
3636

37+
report.AppendLine("Graphics Versions");
38+
report.AppendLine();
39+
try {
40+
var status = ADL.ADL_Graphics_Versions_Get(out var versionInfo);
41+
report.Append(" Status: ");
42+
report.AppendLine(status.ToString());
43+
report.Append(" DriverVersion: ");
44+
report.AppendLine(versionInfo.DriverVersion);
45+
report.Append(" CatalystVersion: ");
46+
report.AppendLine(versionInfo.CatalystVersion);
47+
report.Append(" CatalystWebLink: ");
48+
report.AppendLine(versionInfo.CatalystWebLink);
49+
} catch (DllNotFoundException) {
50+
report.AppendLine(" Status: DLL not found");
51+
} catch (Exception e) {
52+
report.AppendLine(" Status: " + e.Message);
53+
}
54+
report.AppendLine();
55+
3756
if (adlStatus == ADLStatus.OK) {
3857
int numberOfAdapters = 0;
3958
ADL.ADL_Adapter_NumberOfAdapters_Get(ref numberOfAdapters);

Properties/AssemblyVersion.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ This Source Code Form is subject to the terms of the Mozilla Public
1010

1111
using System.Reflection;
1212

13-
[assembly: AssemblyVersion("0.9.2.2")]
14-
[assembly: AssemblyInformationalVersion("0.9.2.2 Alpha")]
13+
[assembly: AssemblyVersion("0.9.2.3")]
14+
[assembly: AssemblyInformationalVersion("0.9.2.3 Alpha")]

0 commit comments

Comments
 (0)