@@ -272,9 +272,10 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu
272272 int status = adlData .ffADL2_Overdrive_Caps (adlData .apiHandle , device -> iAdapterIndex , & odSupported , & odEnabled , & odVersion );
273273 FF_DEBUG ("ADL2_Overdrive_Caps returned %s (%d); supported %d, enabled %d; version %d" ,
274274 ffAdlStatusToString (status ), status , odSupported , odEnabled , odVersion );
275- if (! odSupported )
275+ if (status != ADL_OK )
276276 {
277277 FF_DEBUG ("Overdrive not supported, results may be inaccurate" );
278+ // Note even if Overdrive is not supported, we can still get the OD version
278279 }
279280 }
280281
@@ -396,16 +397,23 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu
396397 FF_DEBUG ("ADL2_OverdriveN_SystemClocksX2_Get returned %s (%d), levels: %d" ,
397398 ffAdlStatusToString (status ), status , odPerfLevels -> iNumberOfPerformanceLevels );
398399
399- // lowest to highest
400- for (int i = odPerfLevels -> iNumberOfPerformanceLevels - 1 ; i >= 0 ; i -- )
400+ if (status != ADL_OK )
401401 {
402- ADLODNPerformanceLevelX2 * level = & odPerfLevels -> aLevels [i ];
403- FF_DEBUG ("Performance level %d: enabled: %d, engine clock = %d" , i , level -> iEnabled , level -> iClock );
404- if (level -> iEnabled )
402+ FF_DEBUG ("Failed to get frequency information" );
403+ }
404+ else
405+ {
406+ // lowest to highest
407+ for (int i = odPerfLevels -> iNumberOfPerformanceLevels - 1 ; i >= 0 ; i -- )
405408 {
406- * result .frequency = (uint32_t ) level -> iClock / 100 ; // in 10 kHz
407- FF_DEBUG ("Got max engine clock: %u MHz" , * result .frequency );
408- break ;
409+ ADLODNPerformanceLevelX2 * level = & odPerfLevels -> aLevels [i ];
410+ FF_DEBUG ("Performance level %d: enabled: %d, engine clock = %d" , i , level -> iEnabled , level -> iClock );
411+ if (level -> iEnabled )
412+ {
413+ * result .frequency = (uint32_t ) level -> iClock / 100 ; // in 10 kHz
414+ FF_DEBUG ("Got max engine clock: %u MHz" , * result .frequency );
415+ break ;
416+ }
409417 }
410418 }
411419 }
0 commit comments