How to check which cuda version my pytorch is using - PyTorch Forums
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. Thanks, Jaejin Cho You could check the linked CUDA version via print(torch.version.cuda). Thank you for the quick answer. 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? CUDA_PATH might be the wrong env var. I’m using CUDA_HOME, which works fine. Thank you for the answer! Added this code in
How to check which cuda version my pytorch is using - PyTorch Forums = 40rem)" rel="stylesheet" data-target="desktop" /> = 40rem)" rel="stylesheet" data-target="poll_desktop" /> How to check which cuda version my pytorch is using JaeJin_Cho (JaeJin Cho) March 31, 2021, 3:57pm 1 Hello! 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
Explore this link on the map →related reading
- Get Startedpytorch.org
- Previous PyTorch Versionspytorch.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- the bug that taught me more about PyTorch than years of using it | Elana Simonelanapearl.github.io
- CUDA C++ Programming Guide (Legacy) — CUDA C++ Programming Guidedocs.nvidia.com
- The Teclado Blogblog.teclado.com
- The Best GPUs for Deep Learning in 2023 — An In-depth Analysistimdettmers.com
- PyTorch (@PyTorch) / Xx.com
- State of torch.compile for training (August 2025) : ezyang's blogblog.ezyang.com
- UW PLSE | How does torch.compile work?uwplse.org
- CUDA - Wikipediaen.wikipedia.org
- <no title> — PyTorch Tutorials 2.13.0+cu130 documentationpytorch.org