diff --git a/src/detection/gpu/gpu_amd.c b/src/detection/gpu/gpu_amd.c index eda0f56ab..5ebbeb2ba 100644 --- a/src/detection/gpu/gpu_amd.c +++ b/src/detection/gpu/gpu_amd.c @@ -272,9 +272,10 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu int status = adlData.ffADL2_Overdrive_Caps(adlData.apiHandle, device->iAdapterIndex, &odSupported, &odEnabled, &odVersion); FF_DEBUG("ADL2_Overdrive_Caps returned %s (%d); supported %d, enabled %d; version %d", ffAdlStatusToString(status), status, odSupported, odEnabled, odVersion); - if (!odSupported) + if (status != ADL_OK) { FF_DEBUG("Overdrive not supported, results may be inaccurate"); + // Note even if Overdrive is not supported, we can still get the OD version } } @@ -396,16 +397,23 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu FF_DEBUG("ADL2_OverdriveN_SystemClocksX2_Get returned %s (%d), levels: %d", ffAdlStatusToString(status), status, odPerfLevels->iNumberOfPerformanceLevels); - // lowest to highest - for (int i = odPerfLevels->iNumberOfPerformanceLevels - 1; i >= 0 ; i--) + if (status != ADL_OK) { - ADLODNPerformanceLevelX2* level = &odPerfLevels->aLevels[i]; - FF_DEBUG("Performance level %d: enabled: %d, engine clock = %d", i, level->iEnabled, level->iClock); - if (level->iEnabled) + FF_DEBUG("Failed to get frequency information"); + } + else + { + // lowest to highest + for (int i = odPerfLevels->iNumberOfPerformanceLevels - 1; i >= 0 ; i--) { - *result.frequency = (uint32_t) level->iClock / 100; // in 10 kHz - FF_DEBUG("Got max engine clock: %u MHz", *result.frequency); - break; + ADLODNPerformanceLevelX2* level = &odPerfLevels->aLevels[i]; + FF_DEBUG("Performance level %d: enabled: %d, engine clock = %d", i, level->iEnabled, level->iClock); + if (level->iEnabled) + { + *result.frequency = (uint32_t) level->iClock / 100; // in 10 kHz + FF_DEBUG("Got max engine clock: %u MHz", *result.frequency); + break; + } } } } diff --git a/src/util/smbiosHelper.c b/src/util/smbiosHelper.c index 0c54f110d..62fed285d 100644 --- a/src/util/smbiosHelper.c +++ b/src/util/smbiosHelper.c @@ -474,7 +474,7 @@ const FFSmbiosHeaderTable* ffGetSmbiosHeaderTable() buffer->SMBIOSMajorVersion, buffer->SMBIOSMinorVersion, buffer->Length); FF_DEBUG("Parsing SMBIOS table structures"); - int structureCount = 0; + FF_MAYBE_UNUSED int structureCount = 0; for ( const FFSmbiosHeader* header = (const FFSmbiosHeader*) buffer->SMBIOSTableData; (const uint8_t*) header < buffer->SMBIOSTableData + buffer->Length;