0

I recently started working on pytorch and cuda (+conda environments).

My working environment is basically a computer clusters where I submit a job via sbatch run_gpu.sbatch file and the computing center will send me back outputs.

The system (main computer) has all the packages and modules like conda, python, cuda, etc. Inside the home/my-user-name directory of it, I have created a conda environment and downloaded pytorch-1.11.0-py3.8_cuda11.5_cudnn8.3.2_0.

To make sure, I loaded Cuda/11.5 (this is in the main computer, not my directory) via .bashrc file.

Is it normal for print(torch.cuda.is_available()) to print False when I do

python;
  import torch
  print(torch.cuda.is_available())

in my conda environment because I haven't submitted a job to que so that it cannot find GPU units in my computer?

Still,

import torch
print(torch.__version__)
print(torch.version.cuda)

gives me results of 1.11.0 and 11.5 as desired.

So I was curious why pytorch and cuda are installed well as desired, but does not seem to be connected to the loaded Cuda/11.5 from the .bashrc file.

If so could you let me know if there is any way to check the connectivity?

Or will this problem be solved once I submit a job to a main computer which has GPU units?

Thank you!

talonmies
  • 70,661
  • 34
  • 192
  • 269
  • `torch.cuda.is_available()` will check for actual physical device with suitable driver. See https://stackoverflow.com/questions/60987997/why-torch-cuda-is-available-returns-false-even-after-installing-pytorch-with – dinhanhx Jun 25 '23 at 14:33

0 Answers0