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, simple, as soon as you know how.

I tried this approach multiple times and it worked.

So let’s say,

You now have two options

You can painstakingly gather the missing information yourself, provided it is available elsewhere, or you can purchase this article quickly and easily for only 1,40  including VAT and have it right away.

I want this information now

Already bought it? Enter password here:

This content is password protected. Enter your password here from the previous step to view it.

Für dich vielleicht ebenfalls interessant …