None of the above work for me, if there is any other solution that could help!
I am running CUDA 12.1 on A100's, torch=2.2.2+cu12.1
Below is the code line and Error I get.
python -c "import torch; print(torch.cuda.get_device_properties(0))"
the error:
Traceback (most recent call last): File "", line 1, in File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/init.py", line 28, in from ._utils_internal import get_file_path, prepare_multiprocessing_environment,
File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/_utils_internal.py", line 4, in import tempfile File "/home/pgouripe/.conda/envs/py39/lib/python3.9/tempfile.py", line 45, in from random import Random as _Random File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/random.py", line 4, in from .. import Tensor ImportError: attempted relative import with no known parent package (py39) [pgouripe@sg048:~/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda]$ cd (py39) [pgouripe@sg048:~]$ python -c "import torch; print(torch.cuda.get_device_properties(0))" Traceback (most recent call last): File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/init.py", line 315, in _lazy_init queued_call() File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/init.py", line 183, in _check_capability capability = get_device_capability(d) File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/init.py", line 439, in get_device_capability prop = get_device_properties(device) File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/init.py", line 457, in get_device_properties return _get_device_properties(device) # type: ignore[name-defined] RuntimeError: device >= 0 && device < num_gpus INTERNAL ASSERT FAILED at "../aten/src/ATen/cuda/CUDAContext.cpp":50, please report a bug to PyTorch. device=1, num_gpus=The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "", line 1, in File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/init.py", line 453, in get_device_properties _lazy_init() # will define _get_device_properties File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/init.py", line 321, in _lazy_init raise DeferredCudaCallError(msg) from e torch.cuda.DeferredCudaCallError: CUDA call failed lazily at initialization with error: device >= 0 && device < num_gpus INTERNAL ASSERT FAILED at "../aten/src/ATen/cuda/CUDAContext.cpp":50, please report a bug to PyTorch. device=1, num_gpus=
CUDA call was originally invoked at:
File "", line 1, in File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/init.py", line 1427, in _C._initExtension(manager_path()) File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/init.py", line 247, in _lazy_call(_check_capability) File "/home/pgouripe/.conda/envs/py39/lib/python3.9/site-packages/torch/cuda/init.py", line 244, in _lazy_call _queued_calls.append((callable, traceback.format_stack()))
Any input will be helpful! Thanks