CUDA.Available Shows as False. No Idea Why?

Hi there,

Hope someone can help me.

I am currently unable to get PyTorch to recognise my card’s CUDA.

I have a laptop with a NVIDIA GeForce GTX1650. I’m running Driver Version: 528.49 CUDA Version: 12.0. I’ve got NVIDIA’s Cuda compilation tools, release 12.1, V12.1.66 installed

I’m running Python v3.10.6 and my system is Windows 10.

After installing PyTorch following the exact installation instructions on PyTorch’s site (selecting the settings PyTorch Build = Stable (2.0.0), Windows, pip, Python, Compute Platform = CUDA 11.8 … and then using the generated command line argument to install)

…then, when using the following code

“import torch
print(torch.version)
print(torch.cuda.is_available())”

It gives the output

“2.0.0+cpu
False”

So it looks like PyTorch isn’t seeing CUDA, and the version of PyTorch that’s installed is a CPU-only version…although the PyTorch version I installed should be CUDA enabled to CUDA 11.8, right (based on the PyTorch command line argument)??

I’m not sure what the cause of this is or how to begin troubleshooting it.

Do I need to install older versions of Nvidia’s drivers and Cuda Compilation Tools (I thought they were supposed to be backwards compatible)?

The only thing I can think of is to try and use the following argument to manually install the cuda-enabled PyTorch in the hopes that works (but that’s because I’m out of ideas)

“pip install https://download.pytorch.org/whl/torch/torch-2.0.0+cu118-cp310-cp310-win_amd64.whl

Any help would be massively appreciated!

Thanks,

AJ

2 Likes

I have exactly the same issue. Have you figured it out?

Hi nothingness6,

Yes, I eventually got it to work. (Still not entirely sure why it was a problem tho).

The solution that worked for me was the one I proposed at the bottom of my post (finding the relevant wheel file on PyTorch’s website (https://download.pytorch.org/whl/torch/) and using a command to install that)

After that, I think I had a separate error relating to fasttext, which I think is one of the dependencies.

The solution I ultimately found for that was to locate and download the relevant wheel file for my version of Python (“fasttext-0.9.2-cp310-cp310-win_amd64.whl”), and install it by running the following command in the command prompt

“python -m pip install FILE_DIRECTORY_INFO\fasttext-0.9.2-cp310-cp310-win_amd64.whl”

After installing, I ran the command “pip list” in the command prompt to print out the list of packages installed and versions, and check the version of torch, fasttext, etc were what I need.

Hope that helps

You, sir, are the hero of the internet. Thank you. Seriously.

Haha. Thanks, Mark.

Glad it worked for you too

Your question ensured that I’m on track, your followup helped me solve the issue, Thank you very much.