docs/source/cuda_environment_variables.rst
.. _cuda_environment_variables:
For more information on CUDA runtime environment variables, see CUDA Environment Variables <https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars>_.
PyTorch Environment Variables
.. list-table:: :header-rows: 1
PYTORCH_NO_CUDA_MEMORY_CACHING1, disables caching of memory allocations in CUDA. This can be useful for debugging.PYTORCH_ALLOC_CONFcuda-memory-management. PYTORCH_CUDA_ALLOC_CONF is its alias and is provided only for backward compatibility.PYTORCH_NVML_BASED_CUDA_CHECK1, before importing PyTorch modules that check if CUDA is available, PyTorch will use NVML to check if the CUDA driver is functional instead of using the CUDA runtime. This can be helpful if forked processes fail with a CUDA initialization error.TORCH_CUDNN_V8_API_LRU_CACHE_LIMIT0 for no limit or a negative value for no caching.TORCH_CUDNN_V8_API_DISABLED1, disables the cuDNN v8 API. And will fall back to the cuDNN v7 API.TORCH_ALLOW_TF32_CUBLAS_OVERRIDE1, forces TF32 enablement, overrides set_float32_matmul_precision setting.TORCH_NCCL_USE_COMM_NONBLOCKING1, enables non-blocking error handling in NCCL.TORCH_NCCL_AVOID_RECORD_STREAMS0, enables fallback to record streams-based synchronization behavior in NCCL.TORCH_CUDNN_V8_API_DEBUG1, sanity check whether cuDNN V8 is being used.CUDA Runtime and Libraries Environment Variables
.. list-table:: :header-rows: 1
CUDA_VISIBLE_DEVICES-1, no GPUs are made available.CUDA_LAUNCH_BLOCKING1, makes CUDA calls synchronous. This can be useful for debugging.CUBLAS_WORKSPACE_CONFIG:[SIZE]:[COUNT].
As an example, the default workspace size per allocation is CUBLAS_WORKSPACE_CONFIG=:4096:2:16:8 which specifies a total size of 2 * 4096 + 8 * 16 KiB.
To force cuBLAS to avoid using workspaces, set CUBLAS_WORKSPACE_CONFIG=:0:0.CUDNN_CONV_WSCAP_DBGCUBLAS_WORKSPACE_CONFIG, this environment variable is used to set the workspace configuration for cuDNN per allocation.CUBLASLT_WORKSPACE_SIZECUBLAS_WORKSPACE_CONFIG, this environment variable is used to set the workspace size for cuBLASLT.CUDNN_ERRATA_JSON_FILENVIDIA_TF32_OVERRIDE0, disables TF32 globally across all kernels, overriding all PyTorch settings.