@@ -10,7 +10,7 @@ struct FFIgclData {
1010 FF_LIBRARY_SYMBOL (ctlEnumerateDevices )
1111 FF_LIBRARY_SYMBOL (ctlGetDeviceProperties )
1212 FF_LIBRARY_SYMBOL (ctlEnumTemperatureSensors )
13- FF_LIBRARY_SYMBOL (ctlTemperatureGetState )
13+ FF_LIBRARY_SYMBOL (ctlTemperatureGetProperties )
1414 FF_LIBRARY_SYMBOL (ctlEnumMemoryModules )
1515 FF_LIBRARY_SYMBOL (ctlMemoryGetProperties )
1616 FF_LIBRARY_SYMBOL (ctlMemoryGetState )
@@ -41,7 +41,7 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe
4141 FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libigcl , igclData , ctlEnumerateDevices )
4242 FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libigcl , igclData , ctlGetDeviceProperties )
4343 FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libigcl , igclData , ctlEnumTemperatureSensors )
44- FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libigcl , igclData , ctlTemperatureGetState )
44+ FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libigcl , igclData , ctlTemperatureGetProperties )
4545 FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libigcl , igclData , ctlEnumMemoryModules )
4646 FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libigcl , igclData , ctlMemoryGetProperties )
4747 FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libigcl , igclData , ctlMemoryGetState )
@@ -204,19 +204,20 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe
204204 uint32_t sensorCount = ARRAY_SIZE (sensors );
205205 if (igclData .ffctlEnumTemperatureSensors (device , & sensorCount , sensors ) == CTL_RESULT_SUCCESS && sensorCount > 0 )
206206 {
207- double sumValue = 0 ;
208- uint32_t availableCount = 0 ;
209207 for (uint32_t iSensor = 0 ; iSensor < sensorCount ; iSensor ++ )
210208 {
211- double value ;
212- if (igclData .ffctlTemperatureGetState (sensors [iSensor ], & value ) == CTL_RESULT_SUCCESS )
209+ ctl_temp_properties_t props = { .Size = sizeof (props ) };
210+ // The official sample code does not set Version
211+ // https://github.com/intel/drivers.gpu.control-library/blob/1bbacbf3814f2fd0d2b930cdf42fad83f3628db9/Samples/Telemetry_Samples/Sample_TelemetryAPP.cpp#L256
212+ if (igclData .ffctlTemperatureGetProperties (sensors [iSensor ], & props ) == CTL_RESULT_SUCCESS )
213213 {
214- sumValue += value ;
215- availableCount ++ ;
214+ if (props .type == CTL_TEMP_SENSORS_GPU )
215+ {
216+ * result .temp = props .maxTemperature ;
217+ break ;
218+ }
216219 }
217220 }
218- if (availableCount > 0 )
219- * result .temp = sumValue / availableCount ;
220221 }
221222 }
222223
0 commit comments