Certainly! Here’s a revised message for the PyTorch community that incorporates your latest attempts and findings:
Hello PyTorch Community,
I’m encountering an issue where PyTorch (torch.cuda.is_available()
) returns False
, indicating it does not recognize CUDA on a university server equipped with NVIDIA GPUs, running CUDA 11.4. I have verified CUDA installation with nvidia-smi
, which confirms CUDA 11.4 is correctly installed.
Environment Details:
- CUDA Version:11.4 (verified with
nvidia-smi
) - PyTorch Version: 2.0.1 (installed using Conda from the
pytorch
channel) - OS: Linux ubuntu
- Python Version: 3.10 (within a Conda environment)
Steps Taken:
- Installed PyTorch 2.0.1 using Conda without specifying
cudatoolkit
version due to initialPackagesNotFoundError
forcudatoolkit=11.4
. - Set CUDA-related environment variables correctly:
CUDA_HOME=/usr/local/cuda-11.4
LD_LIBRARY_PATH
andPATH
include CUDA directories.
- Verified environment variables (
CUDA_HOME
,LD_LIBRARY_PATH
,PATH
) are correctly set. - Restarted the terminal and activated the
medsam
environment again to ensure changes took effect.
Despite these steps, running torch.cuda.is_available()
in Python still returns False
, suggesting PyTorch does not recognize the CUDA installation.
Questions:
- Are there known compatibility issues with PyTorch 2.0.1 and CUDA 11.4?
- Could the issue be related to how PyTorch was installed or the environment setup?
- Are there additional steps I should take to troubleshoot or resolve this issue?
Any advice or suggestions would be greatly appreciated. I’m considering building PyTorch from source as a next step but wanted to reach out for any insights or solutions that might not require this.
Thank you!