pytorch/docs/source/notes
Daniel Dale ce56ee11fd Extend torch.cuda.is_available() to attempt an NVML-based CUDA availability assessment when explicitly requested by the user (#85951)
Fixes #83973 (This is a substitute PR for https://github.com/pytorch/pytorch/pull/85024)

First of all, thanks for your invaluable contributions to PyTorch everyone!

Given how extensively `torch.cuda.is_available` is used in the PyTorch ecosystem, IMHO it's worthwhile to provide downstream libraries/frameworks/users the ability to alter the default behavior of `torch.cuda.is_available` in the context of their PyTorch usage.

I'm confident there are many current and future such use cases which could benefit from leveraging a weakened, NVML-based `torch.cuda.is_available` assessment at a downstream framework's explicit direction (thanks @malfet 81da50a972 !). Though one could always patch out the `torch.cuda.is_available` function with another implementation in a downstream library, I think this environmental variable based configuration option is more convenient and the cost to including the option is quite low.

As discussed in https://github.com/pytorch/pytorch/pull/85024#issuecomment-1261542045, this PR gates new non-default NVML-based CUDA behavior with an environmental variable (PYTORCH_NVML_BASED_CUDA_CHK) that allows a user/framework to invoke non-default, NVML-based `is_available()` assessments if desired.

Thanks again for your work everyone!
@ngimel @malfet @awaelchli

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85951
Approved by: https://github.com/ngimel
2022-10-12 18:37:50 +00:00
..
amp_examples.rst [AMP] Use generic autocast in example, specify dtype (#79579) 2022-06-17 21:32:51 +00:00
autograd.rst Fix typo under docs directory and RELEASE.md (#85896) 2022-09-29 21:41:59 +00:00
broadcasting.rst
cpu_threading_runtimes.svg
cpu_threading_torchscript_inference.rst
cpu_threading_torchscript_inference.svg
cuda.rst Extend torch.cuda.is_available() to attempt an NVML-based CUDA availability assessment when explicitly requested by the user (#85951) 2022-10-12 18:37:50 +00:00
ddp.rst [Docs][BE] DDP doc fix (#71363) 2022-01-18 22:24:51 +00:00
extending.rst (Re-open) Adds cudaMallocAsync as an alternative backend for the CUDA allocator (#82682) 2022-10-12 03:44:21 +00:00
faq.rst Update faq.rst so OOM section mentions checkpoint (#62709) 2021-08-05 07:40:08 -07:00
gradcheck.rst
hip.rst Add note on ifdefing based on CUDA_VERSION for ROCm path (#62850) 2021-08-25 15:02:03 -07:00
large_scale_deployments.rst
modules.rst Update link to tutorial on defining NN modules (#65534) 2021-09-23 11:26:50 -07:00
mps.rst update mps note with more details (#78669) 2022-06-02 20:53:19 +00:00
multiprocessing.rst
numerical_accuracy.rst [CUBLAS][TF32][CUDNN] Update numerical_accuracy.rst (#79537) 2022-09-07 18:30:26 +00:00
randomness.rst Improve reproducibility docs for RNG (#78849) 2022-06-06 14:53:59 +00:00
serialization.rst [DOC] Missing line in serialization notes (#79454) 2022-06-17 18:26:47 +00:00
windows.rst Remove remaining THC code (#69039) 2021-12-08 12:18:08 -08:00