Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Torch not compiled with CUDA enabled despite CUDA installation #1

Open
Btr4k opened this issue Jul 27, 2024 · 1 comment

Comments

@Btr4k
Copy link

Btr4k commented Jul 27, 2024

Hello,

I'm encountering an issue where PyTorch is not recognizing CUDA, even though I have CUDA 12.5 installed on my system. Despite following the installation instructions for a CUDA-compatible version of PyTorch, torch.cuda.is_available() returns False, and attempting to utilize CUDA results in the error: "AssertionError: Torch not compiled with CUDA enabled."

Environment:

OS: Windows 11
PyTorch Version: (specify the version you tried installing)
Python Version: 3.8
CUDA Version: 12.5
GPU Model: NVIDIA GeForce RTX 3070
Command Used for Installation: conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch (adjust this according to the actual command you used)

Steps to Reproduce:

Install PyTorch with the specified CUDA toolkit version.
Run python -c "import torch; print(torch.cuda.is_available())".

The expected outcome is True, but it results in False, indicating that CUDA is not enabled in the installed PyTorch build.

Could you please help me understand if I am missing a step, or if there is an issue with compatibility between the specified versions of PyTorch and CUDA? Any guidance would be appreciated.

Thank you!

@Asma-Alkhaldi
Copy link
Collaborator

Maybe your installation defaults to a CPU-only version. Make sure you installed the correct version of PyTorch that is compatible with your machine. Check this link: https://pytorch.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants