mirror of https://github.com/hpcaitech/ColossalAI
[install]fix setup (#5786)
* fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>pull/5788/head
parent
b9d646fe9e
commit
a1e39f4c0d
|
@ -30,7 +30,7 @@ class _CudaExtension(_CppExtension):
|
||||||
|
|
||||||
# torch.cuda.is_available requires a device to exist, allow building with cuda extension on build nodes without a device
|
# torch.cuda.is_available requires a device to exist, allow building with cuda extension on build nodes without a device
|
||||||
# but where cuda is actually available.
|
# but where cuda is actually available.
|
||||||
cuda_available = torch.cuda.is_available() or bool(os.environ.get('FORCE_CUDA', 0))
|
cuda_available = torch.cuda.is_available() or bool(os.environ.get("FORCE_CUDA", 0))
|
||||||
except:
|
except:
|
||||||
cuda_available = False
|
cuda_available = False
|
||||||
return cuda_available
|
return cuda_available
|
||||||
|
|
Loading…
Reference in New Issue