Skip to content

Commit

Permalink
Added the AMD GPU driver version to the report. Added a check for err…
Browse files Browse the repository at this point in the history
…oneous ActivityPercent values returned by the ADL_Overdrive5_CurrentActivity_Get method.
  • Loading branch information
moellerm committed Mar 11, 2020
1 parent 2019791 commit 8afd593
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
18 changes: 18 additions & 0 deletions Hardware/ATI/ADL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ internal struct ADLODNPerformanceStatus {
public int VDDCI;
}

[StructLayout(LayoutKind.Sequential)]
internal struct ADLVersionsInfo {
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string DriverVersion;

[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string CatalystVersion;

[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string CatalystWebLink;
}

internal enum ADLODNCurrentPowerType {
TOTAL_POWER = 0,
PPT_POWER,
Expand Down Expand Up @@ -357,6 +369,8 @@ public delegate ADLStatus ADL_Overdrive5_ODParameters_GetDelegate(
public delegate ADLStatus ADL2_OverdriveN_PerformanceStatus_GetDelegate(
IntPtr context, int adapterIndex,
out ADLODNPerformanceStatus performanceStatus);
public delegate ADLStatus ADL_Graphics_Versions_GetDelegate(
out ADLVersionsInfo versionInfo);

private static ADL_Main_Control_CreateDelegate
_ADL_Main_Control_Create;
Expand Down Expand Up @@ -401,6 +415,8 @@ public static ADL_Overdrive5_ODParameters_GetDelegate
ADL_Overdrive5_ODParameters_Get;
public static ADL2_OverdriveN_PerformanceStatus_GetDelegate
ADL2_OverdriveN_PerformanceStatus_Get;
public static ADL_Graphics_Versions_GetDelegate
ADL_Graphics_Versions_Get;

private static string dllName;

Expand Down Expand Up @@ -463,6 +479,8 @@ private static void CreateDelegates(string name) {
out ADL_Overdrive5_ODParameters_Get);
GetDelegate("ADL2_OverdriveN_PerformanceStatus_Get",
out ADL2_OverdriveN_PerformanceStatus_Get);
GetDelegate("ADL_Graphics_Versions_Get",
out ADL_Graphics_Versions_Get);
}

static ADL() {
Expand Down
8 changes: 6 additions & 2 deletions Hardware/ATI/ATIGPU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,12 @@ public override void Update() {
coreVoltage.Value = null;
}

coreLoad.Value = Math.Min(adlp.ActivityPercent, 100);
ActivateSensor(coreLoad);
if (adlp.ActivityPercent >= 0 && adlp.ActivityPercent <= 100) {
coreLoad.Value = adlp.ActivityPercent;
ActivateSensor(coreLoad);
} else {
coreLoad.Value = null;
}
} else {
coreClock.Value = null;
memoryClock.Value = null;
Expand Down
19 changes: 19 additions & 0 deletions Hardware/ATI/ATIGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ public ATIGroup(ISettings settings) {
report.AppendLine(adl2Status.ToString());
report.AppendLine();

report.AppendLine("Graphics Versions");
report.AppendLine();
try {
var status = ADL.ADL_Graphics_Versions_Get(out var versionInfo);
report.Append(" Status: ");
report.AppendLine(status.ToString());
report.Append(" DriverVersion: ");
report.AppendLine(versionInfo.DriverVersion);
report.Append(" CatalystVersion: ");
report.AppendLine(versionInfo.CatalystVersion);
report.Append(" CatalystWebLink: ");
report.AppendLine(versionInfo.CatalystWebLink);
} catch (DllNotFoundException) {
report.AppendLine(" Status: DLL not found");
} catch (Exception e) {
report.AppendLine(" Status: " + e.Message);
}
report.AppendLine();

if (adlStatus == ADLStatus.OK) {
int numberOfAdapters = 0;
ADL.ADL_Adapter_NumberOfAdapters_Get(ref numberOfAdapters);
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ This Source Code Form is subject to the terms of the Mozilla Public

using System.Reflection;

[assembly: AssemblyVersion("0.9.2.2")]
[assembly: AssemblyInformationalVersion("0.9.2.2 Alpha")]
[assembly: AssemblyVersion("0.9.2.3")]
[assembly: AssemblyInformationalVersion("0.9.2.3 Alpha")]

0 comments on commit 8afd593

Please sign in to comment.