diff --git a/LibreHardwareMonitorLib/Hardware/Gpu/AmdGpu.cs b/LibreHardwareMonitorLib/Hardware/Gpu/AmdGpu.cs index a7e6cf9..b3e6e34 100644 --- a/LibreHardwareMonitorLib/Hardware/Gpu/AmdGpu.cs +++ b/LibreHardwareMonitorLib/Hardware/Gpu/AmdGpu.cs @@ -140,7 +140,8 @@ internal sealed class AmdGpu : GenericGpu ActivateSensor(_fullscreenFps); } - if (AtiAdlxx.ADL_Overdrive_Caps(_adapterInfo.AdapterIndex, ref supported, ref enabled, ref version) == AtiAdlxx.ADLStatus.ADL_OK) + if (AtiAdlxx.ADL_Method_Exists(nameof(AtiAdlxx.ADL_Overdrive_Caps)) && + AtiAdlxx.ADL_Overdrive_Caps(_adapterInfo.AdapterIndex, ref supported, ref enabled, ref version) == AtiAdlxx.ADLStatus.ADL_OK) { _overdriveApiSupported = supported == AtiAdlxx.ADL_TRUE; _currentOverdriveApiLevel = version; diff --git a/LibreHardwareMonitorLib/Hardware/RyzenSMU.cs b/LibreHardwareMonitorLib/Hardware/RyzenSMU.cs index 9e1b8ac..66481d2 100644 --- a/LibreHardwareMonitorLib/Hardware/RyzenSMU.cs +++ b/LibreHardwareMonitorLib/Hardware/RyzenSMU.cs @@ -162,11 +162,8 @@ internal class RyzenSMU _supportedCPU = Environment.Is64BitOperatingSystem == Environment.Is64BitProcess && SetAddresses(_cpuCodeName); - if (_supportedCPU) - { - InpOut.Open(); + if (_supportedCPU && InpOut.Open()) SetupPmTableAddrAndSize(); - } } private static CpuCodeName GetCpuCodeName(uint family, uint model, uint packageType) @@ -706,9 +703,7 @@ internal class RyzenSMU if (Ring0.WaitPciBusMutex(10)) { if (Ring0.WritePciConfig(0x00, SMU_PCI_ADDR_REG, addr)) - { Ring0.WritePciConfig(0x00, SMU_PCI_DATA_REG, data); - } Ring0.ReleasePciBusMutex(); } @@ -721,9 +716,7 @@ internal class RyzenSMU if (Ring0.WaitPciBusMutex(10)) { if (Ring0.WritePciConfig(0x00, SMU_PCI_ADDR_REG, addr)) - { read = Ring0.ReadPciConfig(0x00, SMU_PCI_DATA_REG, out data); - } Ring0.ReleasePciBusMutex(); }