I am very new to this so its probably something I am doing wrong. But I cannot get PyTorch installed with Cuda. I thought I did manage it but then there was something wrong with the resulting environment that meant I couldnβt install any other packages!
I have Anaconda UI installed and use the Anaconda Prompt. I made a new environment specially for the CUDA stuff using Python 3.11.
My machine has a Nvidia Quadro RTX A2000 I think. Its a Dell Precision workstation laptop. From what I could figure out compatibility wise, I should be OK with CUDA toolkit 11.8 and cuDNN 9.0 both of which are installed. Though curiously, if i use βnvidia-smiβ in the command prompt it tells me the CUDA version is 12.2 (I have never installed that, the driver version is 536.45).
When I go to the PyTorch site and select all the right boxes and run the resulting command it has numerous failed attempts at βSolving Environmentβ and then just sticks on βSolving Environment: /β with a spinning character. So I am now out of ideas!
After typing all that. it suddenly loaded up a load of packages. hit βYβ. let it work, restarted my machine and now it seems to work???
I have PyTorch 2.2.0 and CUDA 11.8 according to:
torch.__version__
and
torch.version.cuda()
although nvidia-smi still reports 12.2 as the CUDA version?
Maybe this will all work somehow? haha
EDIT: So now I am also back to get a ream of errors when trying to install pacakges like pandas or scikit-learn. The error seems to reference βtorchvision-0.15.2-cpupy310h7187fe4_0β.
Your locally CUDA toolkit (including cuDNN, NCCL, and other libs) wonβt be used if you install the PyTorch binaries as they ship with all needed CUDA dependencies.
You need to properly install a compatible NVIDIA driver and can just use any install command from here. E.g. pip install torch will install the current torch==2.2.0+cu121 version which ships with CUDA 12.1 runtime dependencies.
Thatβs the driver and not the locally installed CUDA toolkit to build and develop applications.
Uninstall all other packages as you are trying to mix binaries with and without CUDA support. E.g. torchvision uses the CPU-only version right now in your environment.
If you get stuck, just create a new, clean, and empty virtual environment and run:
So to understand right⦠I am over complicating this? I just need a fairly recent Nvidia driver and then the right combination of pip or conda install commands will take care of it?
EDIT: Also torchvision and torchaudio are perhaps not necessary? I donβt do anything with audio or vision. But I do need recurrent neural networks.
Yes, this is correct. Your locally CUDA toolkit will be used if you build PyTorch from source or a custom CUDA extension. You wonβ't need it to execute PyTorch workloads as the binaries (pip wheels and conda binaries) install all needed requirements. You would however need to install an NVIDIA driver to allow the communication with your GPU.
In this case you could skip installing these libs and could stick to PyTorch only.
It means when I ask torch if there is a cuda processor available it says FALSE.
torch.cuda.is_available()
= FALSE
I noticed when it was installing packages that it was only selecting the CPU variant of PyTorch.
So I donβt know what to do really, I think I will just leave it for now. There is a new guy from Japan in my office and he seems to know how to get it set up so I will ask him to help me.
Without any information on how youβve tried to install it, we wonβt be able to help.
Creating a new environment and installing PyTorch via pip install torch works fine:
Anyway⦠I completely remove all traces of python and VS Code from my machine and then reinstalled python via Anaconda. I made no venvs or anything like that, I will just work in (base) because I am not doing multiple things.
I then just installed PyTorch by the command given by the website when selecting latest versions of everything:
How did you install cuda-12.1 in windows? I am working on Windows 10 Dell computer, Previously I have successfully install CUDA11.7 but when i try to install cuda 12.1 from CUDA Toolkit 12.1 Update 1 Downloads | NVIDIA Developer
I could not install the exe file. (note that double click does not work, i renamed .exe to .7zip and unzipped and ran ./setup.exe, that install file fails in the end )
Please let me know how did you install cuda 12.1 installer file in windows 10 computer?