ptrblck:

Depending how you’ve installed PyTorch, you can pick between the CPU and CUDA runtimes as described in the install instructions.


The sys admin installed PyTorch. I don’t know what parameters he used for installation. Does PyTorch keep a copy of command line used for installation?



 ptrblck:

Check print(torch.version.cuda) as well as python -m torch.utils.collect_env and make sure a CUDA runtime is found.


print(torch.version.cuda) returns

11.1

When I ran torch.utils.collect_env inside python3 command line (to incorporate code that sets OPENBLAS_NUM_THREADS variable), I was told

Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
AttributeError: module ‘torch.utils’ has no attribute ‘collect_env’

But I downloaded the code of collect_env.py here 1 and run it (with a line to set OPENBLAS_NUM_THREADS variable added). The output is as follows:

Collecting environment information…
/usr/local/lib/python3.8/dist-packages/torch/cuda/init.py:52: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 2: out of memory (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:109.)
return torch._C._cuda_getDeviceCount() > 0
PyTorch version: 1.8.0+cu111
Is debug build: False
CUDA used to build PyTorch: 11.1
ROCM used to build PyTorch: N/A
OS: Pop!_OS 20.10 (x86_64)
GCC version: (Ubuntu 10.2.0-13ubuntu1) 10.2.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.32
Python version: 3.8.6 (default, Jan 27 2021, 15:42:20)  [GCC 10.2.0] (64-bit runtime)
Python platform: Linux-5.8.0-7642-generic-x86_64-with-glibc2.32
Is CUDA available: False
CUDA runtime version: 11.1.105
GPU models and configuration: GPU 0: GeForce RTX 3090
Nvidia driver version: 455.23.05
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Versions of relevant libraries:
[pip3] numpy==1.19.5
[pip3] torch==1.8.0+cu111
[pip3] torchvision==0.9.0+cu111
[conda] Could not collect

It gives the same error as running torch.cuda.is_available() and torch.cuda.device_count(). Is the CUDA runtime found?
PS, Pop!_OS is a variant of ubuntu. conda is actually installed in the system which I detected using command  dpkg -l|grep conda:

ii  conda-package-handling                           1.7.0-1
amd64        create and extract conda packages of various formats

Please let me know what I can do on my side for further troubleshooting.