I have a new Dell XPS 9640 with a NVIDIA RTX 4070. I have installed torch v 2.2.2 and Python 3.12.2, and am using the latest version of VSCode. a simple Python script indicates GPU is not available. What am I missing here?
Assuming you have installed the correct PyTorch binary with CUDA support, you might want to check your NVIDIA drivers and reinstall them if needed.
when I show torch in terminal it reports:
Name: torch
Version: 2.2.2
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: c:\Users\rdcap\pythonScripts.venv\Lib\site-packages
Requires: filelock, fsspec, jinja2, networkx, sympy, typing-extensions
Required-by: torchaudio, torchvision
nvidia reports:
What does torch.__version__
and torch.version.cuda
return?
torch.version says 2.2.2+cpu (oops! shouldn’t it say +GPU?) and if so, how do I get the right version
Yes, it should show a valid CUDA runtime version. Refer to the install instructions. The easiest way would be to simply run pip install torch
, which will install the latest stable PyTorch release with CUDA 12.1.
i installed torch with pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu124/torch_stable.html
This install command is invalid and not listed in the support matrix.
The CUDA 12.4 builds are still being worked on, so stick to the provided install commands.
Fixed! I backed up to cuda 12.1 and the gpu is available. thanks for your help
Hey guys,
Just a note of thanks. This info was very helpful.