@@ -40,7 +40,7 @@ def test_clk_mon_status_t():
4040
4141def test_current_clock_freqs (all_devices , subtests ):
4242 for device in all_devices :
43- with subtests .test (device = device ):
43+ with subtests .test (device_index = nvml . device_get_index ( device ) ):
4444 with unsupported_before (device , None ):
4545 clk_freqs = nvml .device_get_current_clock_freqs (device )
4646 assert isinstance (clk_freqs , str )
@@ -72,7 +72,7 @@ def test_get_handle_by_uuidv(all_devices):
7272
7373def test_get_nv_link_supported_bw_modes (all_devices , subtests ):
7474 for device in all_devices :
75- with subtests .test (device = device ):
75+ with subtests .test (device_index = nvml . device_get_index ( device ) ):
7676 with unsupported_before (device , None ):
7777 modes = nvml .device_get_nvlink_supported_bw_modes (device )
7878 assert isinstance (modes , nvml .NvlinkSupportedBwModes_v1 )
@@ -92,7 +92,7 @@ def test_device_get_pdi(all_devices):
9292
9393def test_device_get_performance_modes (all_devices , subtests ):
9494 for device in all_devices :
95- with subtests .test (device = device ):
95+ with subtests .test (device_index = nvml . device_get_index ( device ) ):
9696 with unsupported_before (device , None ):
9797 modes = nvml .device_get_performance_modes (device )
9898 assert isinstance (modes , str )
@@ -101,15 +101,15 @@ def test_device_get_performance_modes(all_devices, subtests):
101101@pytest .mark .skipif (cuda_version_less_than (13010 ), reason = "Introduced in 13.1" )
102102def test_device_get_unrepairable_memory_flag (all_devices , subtests ):
103103 for device in all_devices :
104- with subtests .test (device = device ):
104+ with subtests .test (device_index = nvml . device_get_index ( device ) ):
105105 with unsupported_before (device , None ):
106106 status = nvml .device_get_unrepairable_memory_flag_v1 (device )
107107 assert isinstance (status , int )
108108
109109
110110def test_device_vgpu_get_heterogeneous_mode (all_devices , subtests ):
111111 for device in all_devices :
112- with subtests .test (device = device ):
112+ with subtests .test (device_index = nvml . device_get_index ( device ) ):
113113 with unsupported_before (device , None ):
114114 mode = nvml .device_get_vgpu_heterogeneous_mode (device )
115115 assert isinstance (mode , int )
@@ -118,7 +118,7 @@ def test_device_vgpu_get_heterogeneous_mode(all_devices, subtests):
118118@pytest .mark .skipif (cuda_version_less_than (13010 ), reason = "Introduced in 13.1" )
119119def test_read_prm_counters (all_devices , subtests ):
120120 for device in all_devices :
121- with subtests .test (device = device ):
121+ with subtests .test (device_index = nvml . device_get_index ( device ) ):
122122 counters = nvml .PRMCounter_v1 (5 )
123123 with unsupported_before (device , None ):
124124 read_counters = nvml .device_read_prm_counters_v1 (device , counters )
@@ -129,7 +129,7 @@ def test_read_prm_counters(all_devices, subtests):
129129@pytest .mark .thread_unsafe (reason = "API appears to be thread-unsafe (2026-06)" )
130130def test_read_write_prm (all_devices , subtests ):
131131 for device in all_devices :
132- with subtests .test (device = device ):
132+ with subtests .test (device_index = nvml . device_get_index ( device ) ):
133133 # Docs say supported in BLACKWELL or later
134134 with unsupported_before (device , None ):
135135 try :
@@ -144,13 +144,16 @@ def test_read_write_prm(all_devices, subtests):
144144def test_get_power_management_limit (all_devices , subtests ):
145145 for device in all_devices :
146146 # Docs say supported on FERMI or later
147- with subtests .test (device = device ), unsupported_before (device , "FERMI" ):
147+ with subtests .test (device_index = nvml . device_get_index ( device ) ), unsupported_before (device , "FERMI" ):
148148 nvml .device_get_power_management_limit (device )
149149
150150
151151def test_set_power_management_limit (all_devices , subtests ):
152152 for device in all_devices :
153- with subtests .test (device = device ), unsupported_before (device , nvml .DeviceArch .KEPLER ):
153+ with (
154+ subtests .test (device_index = nvml .device_get_index (device )),
155+ unsupported_before (device , nvml .DeviceArch .KEPLER ),
156+ ):
154157 try :
155158 nvml .device_set_power_management_limit_v2 (device , nvml .PowerScope .GPU , 10000 )
156159 except nvml .NoPermissionError :
@@ -161,7 +164,7 @@ def test_set_power_management_limit(all_devices, subtests):
161164
162165def test_set_temperature_threshold (all_devices , subtests ):
163166 for device in all_devices :
164- with subtests .test (device = device ):
167+ with subtests .test (device_index = nvml . device_get_index ( device ) ):
165168 # Docs say supported on MAXWELL or newer
166169 with unsupported_before (device , None ):
167170 temp = nvml .device_get_temperature_threshold (
0 commit comments