File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -253,23 +253,21 @@ def get_extensions():
253
253
if debug_mode :
254
254
print ("Compiling in debug mode" )
255
255
256
- if not torch .cuda . is_available () :
256
+ if not torch .version . cuda :
257
257
print (
258
258
"PyTorch GPU support is not available. Skipping compilation of CUDA extensions"
259
259
)
260
- if CUDA_HOME is None and torch .cuda . is_available () and torch . version .cuda :
260
+ if CUDA_HOME is None and torch .version .cuda :
261
261
print ("CUDA toolkit is not available. Skipping compilation of CUDA extensions" )
262
262
print (
263
263
"If you'd like to compile CUDA extensions locally please install the cudatoolkit from https://anaconda.org/nvidia/cuda-toolkit"
264
264
)
265
- if ROCM_HOME is None and torch .cuda . is_available () and torch . version .hip :
265
+ if ROCM_HOME is None and torch .version .hip :
266
266
print ("ROCm is not available. Skipping compilation of ROCm extensions" )
267
267
print ("If you'd like to compile ROCm extensions locally please install ROCm" )
268
268
269
- use_cuda = (
270
- torch .cuda .is_available () and torch .version .cuda and CUDA_HOME is not None
271
- )
272
- use_hip = torch .cuda .is_available () and torch .version .hip and ROCM_HOME is not None
269
+ use_cuda = torch .version .cuda and CUDA_HOME is not None
270
+ use_hip = torch .version .hip and ROCM_HOME is not None
273
271
extension = CUDAExtension if (use_cuda or use_hip ) else CppExtension
274
272
275
273
nvcc_args = [
You can’t perform that action at this time.
0 commit comments