@@ -139,7 +139,7 @@ def get_gpu_uuid(self, target):
139139 return query_string_attribute (self , target , 0 , NV_CTRL_STRING_GPU_UUID )
140140
141141
142- def get_gpu_utilization (self , target ):
142+ def get_utilization_rates (self , target ):
143143 string = query_string_attribute (self , target , 0 , NV_CTRL_STRING_GPU_UTILIZATION )
144144 result = {}
145145 if string is not None and string != '' :
@@ -162,6 +162,16 @@ def get_performance_modes(self, target):
162162 return result
163163
164164
165+ def get_clock_info (self , target ):
166+ string = query_string_attribute (self , target , 0 , NV_CTRL_STRING_GPU_CURRENT_CLOCK_FREQS )
167+ result = {}
168+ if string is not None and string != '' :
169+ for line in string .split (',' ):
170+ [key , value ] = line .split ('=' )[:2 ]
171+ result [key .strip ()] = int (value ) if value .isdigit () else value
172+ return result
173+
174+
165175def get_vram (self , target ):
166176 return query_int_attribute (self , target , 0 , NV_CTRL_VIDEO_RAM )
167177
@@ -231,23 +241,23 @@ def get_used_dedicated_gpu_memory(self, target):
231241 return query_int_attribute (self , target , 0 , NV_CTRL_USED_DEDICATED_GPU_MEMORY )
232242
233243
234- def get_pcie_current_link_width (self , target ):
244+ def get_curr_pcie_link_width (self , target ):
235245 return query_int_attribute (self , target , 0 , NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH )
236246
237247
238- def get_pcie_max_link_width (self , target ):
248+ def get_max_pcie_link_width (self , target ):
239249 return query_int_attribute (self , target , 0 , NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH )
240250
241251
242- def get_pcie_generation (self , target ):
252+ def get_curr_pcie_link_generation (self , target ):
243253 return query_int_attribute (self , target , 0 , NV_CTRL_GPU_PCIE_GENERATION )
244254
245255
246- def get_video_encoder_utilization (self , target ):
256+ def get_encoder_utilization (self , target ):
247257 return query_int_attribute (self , target , 0 , NV_CTRL_VIDEO_ENCODER_UTILIZATION )
248258
249259
250- def get_video_decoder_utilization (self , target ):
260+ def get_decoder_utilization (self , target ):
251261 return query_int_attribute (self , target , 0 , NV_CTRL_VIDEO_DECODER_UTILIZATION )
252262
253263
@@ -354,11 +364,11 @@ def init(disp, info):
354364 disp .extension_add_method ('display' , 'nvcontrol_get_memory_bus_width' , get_memory_bus_width )
355365 disp .extension_add_method ('display' , 'nvcontrol_get_total_dedicated_gpu_memory' , get_total_dedicated_gpu_memory )
356366 disp .extension_add_method ('display' , 'nvcontrol_get_used_dedicated_gpu_memory' , get_used_dedicated_gpu_memory )
357- disp .extension_add_method ('display' , 'nvcontrol_get_pcie_current_link_width ' , get_pcie_current_link_width )
358- disp .extension_add_method ('display' , 'nvcontrol_get_pcie_max_link_width ' , get_pcie_max_link_width )
359- disp .extension_add_method ('display' , 'nvcontrol_get_pcie_generation ' , get_pcie_generation )
360- disp .extension_add_method ('display' , 'nvcontrol_get_video_encoder_utilization ' , get_video_encoder_utilization )
361- disp .extension_add_method ('display' , 'nvcontrol_get_video_decoder_utilization ' , get_video_decoder_utilization )
367+ disp .extension_add_method ('display' , 'nvcontrol_get_curr_pcie_link_width ' , get_curr_pcie_link_width )
368+ disp .extension_add_method ('display' , 'nvcontrol_get_max_pcie_link_width ' , get_max_pcie_link_width )
369+ disp .extension_add_method ('display' , 'nvcontrol_get_curr_pcie_link_generation ' , get_curr_pcie_link_generation )
370+ disp .extension_add_method ('display' , 'nvcontrol_get_encoder_utilization ' , get_encoder_utilization )
371+ disp .extension_add_method ('display' , 'nvcontrol_get_decoder_utilization ' , get_decoder_utilization )
362372 disp .extension_add_method ('display' , 'nvcontrol_get_current_performance_level' , get_current_performance_level )
363373 disp .extension_add_method ('display' , 'nvcontrol_get_gpu_nvclock_offset' , get_gpu_nvclock_offset )
364374 disp .extension_add_method ('display' , 'nvcontrol_set_gpu_nvclock_offset' , set_gpu_nvclock_offset )
@@ -375,8 +385,9 @@ def init(disp, info):
375385 disp .extension_add_method ('display' , 'nvcontrol_get_driver_version' , get_driver_version )
376386 disp .extension_add_method ('display' , 'nvcontrol_get_vbios_version' , get_vbios_version )
377387 disp .extension_add_method ('display' , 'nvcontrol_get_gpu_uuid' , get_gpu_uuid )
378- disp .extension_add_method ('display' , 'nvcontrol_get_gpu_utilization ' , get_gpu_utilization )
388+ disp .extension_add_method ('display' , 'nvcontrol_get_utilization_rates ' , get_utilization_rates )
379389 disp .extension_add_method ('display' , 'nvcontrol_get_performance_modes' , get_performance_modes )
390+ disp .extension_add_method ('display' , 'nvcontrol_get_clock_info' , get_clock_info )
380391 disp .extension_add_method ('display' , 'nvcontrol_set_cooler_manual_control_enabled' ,
381392 set_cooler_manual_control_enabled )
382393 disp .extension_add_method ('display' , 'nvcontrol_get_gpu_nvclock_offset_range' ,
0 commit comments