CUDA GPU not getting detected after Python environment update

Hi,

I am facing strange issue with my NVIDIA GPU. It was working fine before, but after updating my Python environment and some ML packages, CUDA is not detecting the GPU properly.

nvidia-smi is showing the GPU, but when I run my Python code it says CUDA is not available.

I already tried reinstalling the CUDA related packages and restarting the system, but still same issue.

Anyone faced this before? Is there something I should check between the NVIDIA driver, CUDA version and Python environment?

nvidia-smi only shows the driver, so if it sees the GPU the driver is fine. Check torch.version.cuda. If it is None the update installed the CPU build of torch. Reinstall the CUDA build of torch and it will see the GPU again.