NVIDIA GeForce RTX 3060 with CUDA capability sm_86 is not compatible with the current PyTorch installation

I would like to have sm_86 system wide enabled. In python outside conda:

python -c "import torch; print(torch.__version__); print(torch.cuda.get_arch_list())"
1.12.0
[]

In conda(base):

python -c "import torch; print(torch.__version__); print(torch.cuda.get_arch_list())"
1.12.0
['sm_37', 'sm_50', 'sm_60', 'sm_61', 'sm_70', 'sm_75', 'sm_80', 'sm_86', 'compute_37']

So I understand from what Ive researched the issue is the torch which comes with the cuda binaries right? So I need to build it from source.

So I tried:

 pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu116
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/nightly/cu116
Requirement already satisfied: torch in /usr/lib/python3.10/site-packages (1.12.0)
Requirement already satisfied: torchvision in /home/vfbsilva/.local/lib/python3.10/site-packages (0.13.0)
Collecting torchaudio
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220724%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.2 MB/s eta 0:00:00
Requirement already satisfied: typing_extensions in /usr/lib/python3.10/site-packages (from torch) (4.2.0)
Requirement already satisfied: numpy in /usr/lib/python3.10/site-packages (from torchvision) (1.23.0)
Requirement already satisfied: requests in /usr/lib/python3.10/site-packages (from torchvision) (2.27.1)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/lib/python3.10/site-packages (from torchvision) (9.2.0)
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220723%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220722%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.1 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220721%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.7 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220720%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.7 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220719%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.4 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220718%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.7 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220717%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.7 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220716%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.7 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220715%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.5 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220714%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.3 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220713%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.3 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220712%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.5 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220711%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.4 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220710%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.0 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220709%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.4 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220708%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.7 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220707%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.3 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220706%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.1 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220705%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.5 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220704%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.3 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220703%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.4 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220702%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.0 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220701%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220630%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220629%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.8 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220628%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220627%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.1 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220626%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.3 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220625%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220624%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.5 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220623%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.4 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220622%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220621%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.2 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220620%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.5 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220619%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220618%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220617%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.4 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220616%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220615%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.5 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220613%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.4 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220612%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220611%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.5 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220610%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 5.4 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220609%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.6 MB/s eta 0:00:00
  Downloading https://download.pytorch.org/whl/nightly/cu116/torchaudio-0.13.0.dev20220608%2Bcu116-cp310-cp310-linux_x86_64.whl (3.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 4.7 MB/s eta 0:00:00
  Downloading torchaudio-0.12.0-cp310-cp310-manylinux1_x86_64.whl (3.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.7/3.7 MB 2.8 MB/s eta 0:00:00
Requirement already satisfied: chardet>=3.0.2 in /usr/lib/python3.10/site-packages (from requests->torchvision) (4.0.0)
Requirement already satisfied: idna>=2.5 in /usr/lib/python3.10/site-packages (from requests->torchvision) (3.3)
Requirement already satisfied: urllib3>=1.21.1 in /usr/lib/python3.10/site-packages (from requests->torchvision) (1.26.9)
Installing collected packages: torchaudio
Successfully installed torchaudio-0.12.0
vfbsilva@rohan ~/Source/vcdoc_oo/vcdoc/inferencia/mvp/application $ python -c "import torch; print(torch.__version__); print(torch.cuda.get_arch_list())"1.12.0
[]

So now I’m a bit confuse, cause looking at: GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration

It reports to use the conda environment to build it. But my conda env is oki. What should I do?

No, you don’t need to build PyTorch from source and would only need to install the right PyTorch binary with a CUDA 11.x runtime for your RTX 3060.

Based on your outputs you have multiple PyTorch binaries installed. The one in conda (base) is shipping with the right compute capabilities for your GPU, the other in in the default Python environment seems to be a CPU-only binary.

Your install command for the nightly binaries is not installing torch as pip already finds a package:

Requirement already satisfied: torch in /usr/lib/python3.10/site-packages (1.12.0)

Either uninstall all PyTorch binaries via pip uninstall torch and conda uninstall pytorch (run it a few times until no package can be found) or create a new and clean virtual environment and install the right binaries there.

1 Like

Why do I need to clear the torch in conda? I want to have it only in pip so I need to uninstall it on pip and install again? is it right?

there’s a pip available in conda too. So, ptrblck’s suggestion shows you how to clear out all pytorch installs and reinstall as he suggests, i.e. the CUDA 11 based pytorch binaries.

1 Like

Doing it:


pip3 install torch torchvision torchaudio --extra-index-url htt
ps://download.pytorch.org/whl/cu116
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu11
6
Collecting torch
Downloading https://download.pytorch.org/whl/cu116/torch-1.12.0%2Bcu116-cp310-cp
310-linux_x86_64.whl (1904.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.9/1.9 GB 1.4 MB/s eta 0:00:00
Requirement already satisfied: torchvision in ./.local/lib/python3.10/site-package
s (0.13.0)
Requirement already satisfied: torchaudio in ./.local/lib/python3.10/site-packages
(0.12.0)
Requirement already satisfied: typing-extensions in /usr/lib/python3.10/site-packa
ges (from torch) (4.2.0)
Requirement already satisfied: numpy in /usr/lib/python3.10/site-packages (from to
rchvision) (1.23.0)
Requirement already satisfied: requests in /usr/lib/python3.10/site-packages (from
torchvision) (2.27.1)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/lib/python3.10/site-p
ackages (from torchvision) (9.2.0)
Requirement already satisfied: chardet>=3.0.2 in /usr/lib/python3.10/site-packages
(from requests->torchvision) (4.0.0)
Requirement already satisfied: idna>=2.5 in /usr/lib/python3.10/site-packages (fro
m requests->torchvision) (3.3)
Requirement already satisfied: urllib3>=1.21.1 in /usr/lib/python3.10/site-package
s (from requests->torchvision) (1.26.9)
Installing collected packages: torch
Successfully installed torch-1.12.0+cu116
(base) vfbsilva@rohan ~ $ python -c "import torch; print(torch.__version__); print(torch.cuda.get_arch_list())"
1.13.0.dev20220724+cu116
['sm_37', 'sm_50', 'sm_60', 'sm_70', 'sm_75', 'sm_80', 'sm_86']
(base) vfbsilva@rohan ~ $ conda deactivate
vfbsilva@rohan ~ $ python -c "import torch; print(torch.__version__); print(torch.cuda.get_arch_list())"
1.12.0+cu116
['sm_37', 'sm_50', 'sm_60', 'sm_70', 'sm_75', 'sm_80', 'sm_86']

This seems alright.
But running my docker app still results in errors:

docker run -it --gpus '"device=0"' --name teste_vcdoc_minha_gpu --rm -p 8081:8081 teste_vcdoc_minhagpu
/opt/python/venv/lib/python3.7/site-packages/torchvision/models/_utils.py:253: UserWarning: Accessing the model URLs via the internal dictionary of the module is deprecated since 0.13 and will be removed in 0.15. Please access them via the appropriate Weights Enum instead.
  "Accessing the model URLs via the internal dictionary of the module is deprecated since 0.13 and will "
/opt/python/venv/lib/python3.7/site-packages/torchvision/models/_utils.py:209: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
  f"The parameter '{pretrained_param}' is deprecated since 0.13 and will be removed in 0.15, "
/opt/python/venv/lib/python3.7/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=None`.
  warnings.warn(msg)
/opt/python/venv/lib/python3.7/site-packages/torch/cuda/__init__.py:146: UserWarning: 
NVIDIA GeForce RTX 3060 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA GeForce RTX 3060 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
^CTraceback (most recent call last):
  File "/opt/python/venv/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 179, in flatten_parameters
    self.batch_first, bool(self.bidirectional))
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "darknet_server/vcdoc_server.py", line 513, in <module>
    main()
  File "darknet_server/vcdoc_server.py", line 438, in main
    vc_doc_functions.inicializa_variaveis_globais(path_prog)
  File "/opt/python/app/darknet_server/vc_doc_functions.py", line 295, in inicializa_variaveis_globais
    vc_ocr.inicializa_easyocr(path_prog)
  File "/opt/python/app/darknet_server/vc_ocr.py", line 206, in inicializa_easyocr
    READER_EASYOCR = EASY.Reader(['en','pt','es','it'],gpu=True)
  File "/opt/python/venv/lib/python3.7/site-packages/easyocr/easyocr.py", line 241, in __init__
    dict_list, model_path, device = self.device, quantize=quantize)
  File "/opt/python/venv/lib/python3.7/site-packages/easyocr/recognition.py", line 181, in get_recognizer
    model = torch.nn.DataParallel(model).to(device)
  File "/opt/python/venv/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 145, in __init__
    self.module.to(self.src_device_obj)
  File "/opt/python/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 927, in to
    return self._apply(convert)
  File "/opt/python/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 579, in _apply
    module._apply(fn)
  File "/opt/python/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 579, in _apply
    module._apply(fn)
  File "/opt/python/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 579, in _apply
    module._apply(fn)
  File "/opt/python/venv/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 189, in _apply
    self.flatten_parameters()
  File "/opt/python/venv/lib/python3.7/site-packages/torch/nn/modules/rnn.py", line 179, in flatten_parameters
    self.batch_first, bool(self.bidirectional))
KeyboardInterrupt

Am I oki? Now I need to rebuild that docker image with the same wheels right?

In this case your docker container image teste_vcdoc_minhagpu does not have the right Python binary installed or built. I don’t know if you expect to see a PyTorch source build inside this docker container but in any case you would either need to rebuild it for the right GPU arcitecture (sm_86 in your case) or install the pip wheels in the same way as in your local environment (i.e. outside of the container).

1 Like

English is not my mother language so sorry if I do miss interpret you. But you mentioned I need to install the pip wheels outside the container thats is what I did in both environments and calling it from the python install that presented the right capabilities resulted in the last error I posted.

So now I’m installing those wheels inside the container. I still have difficulty to grasp this compatibility layer.

In your first post you didn’t mention that you are using a docker container so I assumed you want to execute your Python script locally.
Note that a docker container is isolating the environment so none of your locally installed applications should be visible inside the container and vice versa.
So if you want to execute PyTorch inside a container you would have to install the right binaries there as well.

1 Like

I’m aware that I didnΒ΄t mention. The problem was two fold:

  • first I had messed all my environments before as you well pointed out and helped me to fix. :white_check_mark:
  • second I need to add the well files to the container. :stop_sign:

First part is oki. To achieve the second part from what I’ve read here. I need to add:

-i https://download.pytorch.org/whl/cu116
 torch==1.12.0+cu116
 torchvision==0.2.1
 torchaudio

To requirements.txt