I have multiple CUDA versions installed on the server, e.g., /opt/NVIDIA/cuda-9.1 and /opt/NVIDIA/cuda-10, and /usr/local/cuda is linked to the latter one. I believe I installed my pytorch with cuda 10.2 based on what I get from running torch.version.cuda.
How can I check which version of CUDA that the installed pytorch actually uses in running? I set my CUDA_PATH=/opt/NVIDIA/cuda-9.1 but it still seems to run without any problem on a gpu.
I actually used “torch.version.cuda” and checked it as in my original post (and it was 10.2). However, I was wondering why it still works with the setting “CUDA_PATH=/opt/NVIDIA/cuda-9.1”. In other words, how it finds the correct cuda version to use (or which environment variable it uses to do so) in run-time?
PyTorch ships with its own CUDA dependencies and your locally installed CUDA toolkit will be used if you build PyTorch from source or a custom CUDA extension.