R
RunPod6mo ago
Niels_

CUDA not recognized

Hi, I'dl like to run a PyTorch model on a GPU, but for some reason the GPU is not recognized by PyTorch even though I'm specifying a template that includes CUDA.
6 Replies
Niels_
Niels_6mo ago
I'm getting the following:
>>> import torch
>>> torch.cuda.is_available()
/usr/local/lib/python3.10/dist-packages/torch/cuda/__init__.py:138: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:108.)
return torch._C._cuda_getDeviceCount() > 0
>>> import torch
>>> torch.cuda.is_available()
/usr/local/lib/python3.10/dist-packages/torch/cuda/__init__.py:138: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:108.)
return torch._C._cuda_getDeviceCount() > 0
` The template I'm using is runpod/pytorch:2.1.1-py3.10-cuda12.1.1-devel-ubuntu22.04
Justin Merrell
Justin Merrell6mo ago
May you run nvidia-smi in the console?
Niels_
Niels_6mo ago
Justin Merrell
Justin Merrell6mo ago
What is the pod id?
Niels_
Niels_6mo ago
fho00ms04wxzxw
sane
sane6mo ago
I have the same problem with NVIDIA 4090 pods and cuda 12.1 / torch 2.1 pods with other GPUs and same cuda / torch versions works well