33
44# DeepSpeed Team
55
6+ import os
67from .builder import CUDAOpBuilder , installed_cuda_version
78
89
@@ -26,19 +27,20 @@ def is_compatible(self, verbose=False):
2627 return False
2728
2829 cuda_okay = True
29- if not self .is_rocm_pytorch () and torch .cuda .is_available ():
30- sys_cuda_major , _ = installed_cuda_version ()
31- torch_cuda_major = int (torch .version .cuda .split ('.' )[0 ])
32- cuda_capability = torch .cuda .get_device_properties (0 ).major
33- if cuda_capability < 6 :
34- if verbose :
35- self .warning ("NVIDIA Inference is only supported on Pascal and newer architectures" )
36- cuda_okay = False
37- if cuda_capability >= 8 :
38- if torch_cuda_major < 11 or sys_cuda_major < 11 :
30+ if not os .environ .get ("DS_IGNORE_CUDA_DETECTION" ):
31+ if not self .is_rocm_pytorch () and torch .cuda .is_available ():
32+ sys_cuda_major , _ = installed_cuda_version ()
33+ torch_cuda_major = int (torch .version .cuda .split ('.' )[0 ])
34+ cuda_capability = torch .cuda .get_device_properties (0 ).major
35+ if cuda_capability < 6 :
3936 if verbose :
40- self .warning ("On Ampere and higher architectures please use CUDA 11+ " )
37+ self .warning ("NVIDIA Inference is only supported on Pascal and newer architectures " )
4138 cuda_okay = False
39+ if cuda_capability >= 8 :
40+ if torch_cuda_major < 11 or sys_cuda_major < 11 :
41+ if verbose :
42+ self .warning ("On Ampere and higher architectures please use CUDA 11+" )
43+ cuda_okay = False
4244 return super ().is_compatible (verbose ) and cuda_okay
4345
4446 def filter_ccs (self , ccs ):
0 commit comments