File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,13 +136,19 @@ def test_device_get_p2p_status(handles, index):
136136
137137def test_device_get_power_usage (ngpus , handles ):
138138 for i in range (ngpus ):
139- power_mwatts = nvml .device_get_power_usage (handles [i ])
139+ try :
140+ power_mwatts = nvml .device_get_power_usage (handles [i ])
141+ except nvml .NotSupportedError :
142+ pytest .skip ("device_get_power_usage not supported" )
140143 assert power_mwatts >= 0.0
141144
142145
143146def test_device_get_total_energy_consumption (ngpus , handles ):
144147 for i in range (ngpus ):
145- energy_mjoules1 = nvml .device_get_total_energy_consumption (handles [i ])
148+ try :
149+ energy_mjoules1 = nvml .device_get_total_energy_consumption (handles [i ])
150+ except nvml .NotSupportedError :
151+ pytest .skip ("device_get_total_energy_consumption not supported" )
146152 for j in range (10 ): # idle for 150 ms
147153 time .sleep (0.015 ) # and check for increase every 15 ms
148154 energy_mjoules2 = nvml .device_get_total_energy_consumption (handles [i ])
You can’t perform that action at this time.
0 commit comments