File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ def check_gpus_compute_capability(min_capability):
312312
313313 import importlib .util
314314
315- if importlib .util .find_spec ("cuda.core.experimental" ) :
315+ if importlib .util .find_spec ("cuda" ) is not None :
316316 import cuda .core .experimental as cuda_core_experimental
317317
318318 devices = cuda_core_experimental .system .devices
@@ -325,7 +325,7 @@ def check_gpus_compute_capability(min_capability):
325325 if compute_capability < min_capability :
326326 return False
327327
328- elif importlib .util .find_spec ("pycuda.driver" ) :
328+ elif importlib .util .find_spec ("pycuda" ) is not None :
329329 import pycuda .driver as cuda
330330
331331 cuda .init ()
@@ -339,6 +339,10 @@ def check_gpus_compute_capability(min_capability):
339339
340340 if compute_capability_value < min_capability :
341341 return False
342+ else :
343+ raise RuntimeError (
344+ "No packages found to determine the compute capability. Please check the environment."
345+ )
342346
343347 return True
344348
You can’t perform that action at this time.
0 commit comments