@@ -188,11 +188,15 @@ def test_compute_capability():
188
188
("gpu_direct_rdma_writes_ordering" , int ),
189
189
("mempool_supported_handle_types" , int ),
190
190
("deferred_mapping_cuda_array_supported" , bool ),
191
- ("numa_config" , int ),
192
- ("numa_id" , int ),
193
- ("multicast_supported" , bool ),
194
191
]
195
192
193
+ cuda_12_properties = [("numa_config" , int ), ("numa_id" , int ), ("multicast_supported" , bool )]
194
+
195
+ cuda_11 = True
196
+ if runtime .cudaRuntimeGetVersion () >= (12 , 0 ):
197
+ cuda_base_properties += cuda_12_properties
198
+ cuda_11 = False
199
+
196
200
197
201
@pytest .mark .parametrize ("property_name, expected_type" , cuda_base_properties )
198
202
def test_device_property_types (property_name , expected_type ):
@@ -204,5 +208,12 @@ def test_device_properties_complete():
204
208
device = Device ()
205
209
live_props = set (attr for attr in dir (device .properties ) if not attr .startswith ("_" ))
206
210
tab_props = set (attr for attr , _ in cuda_base_properties )
207
- assert len (tab_props ) == len (cuda_base_properties ) # Ensure no duplicates.
208
- assert tab_props == live_props # Ensure exact match.
211
+
212
+ # Exclude specific properties from the comparison when unsupported by CTK.
213
+ excluded_props = {"numa_config" , "multicast_supported" , "numa_id" } if cuda_11 else set ()
214
+
215
+ filtered_tab_props = tab_props - excluded_props
216
+ filtered_live_props = live_props - excluded_props
217
+
218
+ assert len (filtered_tab_props ) == len (cuda_base_properties ) # Ensure no duplicates.
219
+ assert filtered_tab_props == filtered_live_props # Ensure exact match.
0 commit comments