What to do, when torch.cuda.is_available() is giving false even if Pytorch was installed with CUDA on Windows?
The issues, AssertionError: Torch not compiled with CUDA enabled, modules not found and others on Windows
It is a demoralizing issue when trying to use CUDA accelerated software, for instance in Machine Learning.
The dreaded AssertionError: Torch not compiled with CUDA enabled anyone?
Now, this error took me a long time to fix.
You probably searched Google and found posts on StackOverflow, saying, you should just reinstall CUDA Toolkit.
You did, but still get the same AssertionError. Or you just typed in python, either using a normal install or using anaconda, to then follow this simple string of commands (as suggested on many websites)
import torch print(torch.cuda.is_available())
To then get the dreaded False after hours and hours of reinstalling and setting environment variables.
Then other error messages are thrown, showing that other modules don’t work either.
Then your computer freezes when trying to install Pytorch.
CUDA is now running in the background as I write this, and I am here for the rescue to hopefully fix this issue for everyone.
How to make Cuda run on Windows 10/11 machines?
The solution is, as it is in most cases, quick, as soon as you know how.
Having received your password, you will find the article here. Enter your password and you can view the article in full.
*Durch Klick auf "Mehr lesen" öffnet sich gleichzeitig ein Fenster mit einem Partnerlink im Hintergrund. Sofern du mit diesem später etwas dort kaufst, werde ich daran beteiligt - ohne Mehrkosten für dich. Dafür bekommst du diesen Inhalt kostenlos. Auf manchen Browsern wird direkt zum Partnerlink weitergeleitet. Wechsle dann einfach hierhin zurück, dein kostenloser Inhalt wartet dann auf dich.
Wenn du das nicht möchtest, klicke nicht auf "Mehr lesen".