I try to execute yolov7 train on agx xavier module 32gb but I encounter a problem:
raise AssertionError(“Torch not compiled with CUDA enabled”)
AssertionError: Torch not compiled with CUDA enabled
When installing jetson’s pytorch, I found that the torch version of jetpack5.1 is 2.0, and the information on the official website of pytorch shows that it only supports cuda11.7 or 11.8, so I upgraded agx’s cuda11.4 to 11.8, but this problem still hasn’t been solved.
Yes, I installed it according to the URL. Just now I changed the CUDA version back to 11.4 and still got the same error. Then I tried to re-run the compilation of pytorch. I entered it line by line during the installation. When I entered to python3 -m pip install aiohttp numpy=='1.19.4' scipy=='1.5.3',
An error occurred: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts. pandas 1.5.3 requires numpy>=1.20.3; python_version < "3.10", but you have numpy 1.19.4 which is incompatible. matplotlib 3.7.1 requires numpy>=1.20, but you have numpy 1.19.4 which is incompatible.
And when I typed python3 -m pip install --upgrade protobuf , I encountered an error: ERROR:pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts.onnx 1.13.1 requires protobuf<4,>=3.20.2, but you have protobuf 4.22.1 which is incompatible.
Given the packages that you’ve tried to install and the different CUDA versions you’ve had, it’s difficult for me to speak to what your environment may currently be like. Can you try using the l4t-ml container? It already has PyTorch + torchvision + pandas + scipy installed (and others)
I can refill AGX Xavier to use the latest jetpack5.1.1 and then install pytorch, and then test whether there is any problem, thank you for your continuous reply.
I use a new Jetpack5.1.1 to install pytorch only a little error , it’s at I run python3 -m pip install aiohttp numpy=='1.19.4' scipy=='1.5.3'
the error is ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. onnx-graphsurgeon 0.3.12 requires onnx, which is not installed.
I use python3 -m pip install onnx to fix it
and then I run python3 -m pip install --upgrade protobuf , I get a error is ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. onnx 1.13.1 requires protobuf<4,>=3.20.2, but you have protobuf 4.22.1 which is incompatible.
okay , i try to use python3 -m pip install --upgrade onnx fix it ,but I found Successfully uninstalled protobuf-4.22.1 Successfully installed protobuf-3.20.3
protobuf version is go back to 3.20.3
next I run python3 -m pip install --no-cache $TORCH_INSTALL it’s great , I don’t get any error.
next i try to test pytorch is installed. import torch torch.cuda.current_device()
I got
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/isasp/.local/lib/python3.8/site-packages/torch/cuda/__init__.py", line 674, in current_device
_lazy_init() File "/home/isasp/.local/lib/python3.8/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled
and I keep run
torch.cuda.is_available()
I got
False
so …could you tell me how to fix this? Let pytorch compiled with CUDA enabled. Thank you so much.
If you continue having issues, I recommend you use the l4t-pytorch or l4t-ml containers. They already have PyTorch + torchvision pre-installed (with GPU support) and will keep from all these package conflicts getting installed into your main environment so you aren’t having to re-flash.
Thank you!!! I used new a clean environment (jetpack5.1.1) and your step . Now my Pytorch can return cuda.current_device() and cuda.is_available().
Python 3.8.10 (default, Mar 13 2023, 10:26:41)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.current_device()
0
>>> torch.cuda.is_available()
True