Error flashing Jetson Orin including Cuda

Hi,

I have tried to install Jetson and I have a previos post about flashing Orin. It seems that after installation the Cuda libraries are installed. The board is not recognized by Jetson-Stats. Is it possible to get a good description of how to install Cuda on Orin so that the versions match? I have installed (according to sdk-manager) the latest 5.0.1 DP version of the OS. It also seems in sdk-manager that I have CUDA etc installed.
See attached image.

You need to install Cuda from JetPack via the SDK manager.

I did install the Cuda from SDK-Manager. But it seems it does not work
I run this:
GitHub - ultralytics/yolov5: YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite and after fiddling with

pip install --upgrade torch==1.9.0
pip install --upgrade torchvision==0.10.0

I manage to get pytorch working. But every attemt to run with GPU-support fails:

It runs well with CPU but does not want to work with GPU.

AssertionError: Invalid CUDA '--device 0' requested, use '--device cpu' or pass valid CUDA device(s)

This feels like the version of CUDA is wrong but I dont know how to match CUDA and Pytorch in this case, which I ASSUME is the reason it fails.

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_May__4_00:02:26_PDT_2022
Cuda compilation tools, release 11.4, V11.4.239
Build cuda_11.4.r11.4/compiler.31294910_0

So. I am on the right track. The Pytorch must be the latest.

Upgrading the pytorch to 1.12.0a0+84d1cb9.nv22.4’ By following parts of

(This upgrades protobuf so it needs to be downgraded)
Then downgrading protobuf to:
pip3 install --upgrade protobuf==3.19.4

What happens now is that there is a collision in packages between Pytorch and torchvision.
So. Now There must be a way of getting pytorch 1.12 to work with torchvision…

Blockquote
Traceback (most recent call last):
File “detect.py”, line 252, in
main(opt)
File “detect.py”, line 247, in main
run(**vars(opt))
File “/home/aiadmin/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py”, line 27, in decorate_context
return func(*args, **kwargs)
File “detect.py”, line 127, in run
pred = non_max_suppression(pred, conf_thres, iou_thres, classes, agnostic_nms, max_det=max_det)
File “/home/aiadmin/Development/yolov5/utils/general.py”, line 859, in non_max_suppression
i = torchvision.ops.nms(boxes, scores, iou_thres) # NMS
File “/home/aiadmin/.local/lib/python3.8/site-packages/torchvision/ops/boxes.py”, line 34, in nms
_assert_has_ops()
File “/home/aiadmin/.local/lib/python3.8/site-packages/torchvision/extension.py”, line 62, in _assert_has_ops
raise RuntimeError(
RuntimeError: Couldn’t load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision for the compatibility matrix. Please check your PyTorch version with torch.version and your torchvision version with torchvision.version and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

Anyone getting Orin to work with pytorch and torchvision?
This generates the problem with lastest cuda in 5.0.1 DP:
Pytorch: 1.12.0a0+84d1cb9.nv22.4
Torchvision: 0.12.0

Blockquote
import torchvision
/home/aiadmin/.local/lib/python3.8/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")

Changing torchvision to 0.10.0 it does not complain on import but the

Blockquote
Adding AutoShape…
Traceback (most recent call last):
File “run.py”, line 8, in
results = model(img)
File “/home/aiadmin/.local/lib/python3.8/site-packages/torch/nn/modules/module.py”, line 1111, in _call_impl
return forward_call(*input, **kwargs)
File “/home/aiadmin/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py”, line 27, in decorate_context
return func(*args, **kwargs)
File “/home/aiadmin/.cache/torch/hub/ultralytics_yolov5_master/models/common.py”, line 606, in forward
y = non_max_suppression(y if self.dmb else y[0],
File “/home/aiadmin/.cache/torch/hub/ultralytics_yolov5_master/utils/general.py”, line 859, in non_max_suppression
i = torchvision.ops.nms(boxes, scores, iou_thres) # NMS
File “/home/aiadmin/.local/lib/python3.8/site-packages/torchvision/ops/boxes.py”, line 34, in nms
_assert_has_ops()
File “/home/aiadmin/.local/lib/python3.8/site-packages/torchvision/extension.py”, line 62, in _assert_has_ops
raise RuntimeError(
RuntimeError: Couldn’t load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision for the compatibility matrix. Please check your PyTorch version with torch.version and your torchvision version with torchvision.version and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

still appears

Hi @magnus.gabell, at this point with the various packages that you have tried and installed and the unknown state of your environment, I would recommend seeing if you still encounter this issue when trying the l4t-pytorch container, which already comes with PyTorch and torchvision pre-installed:

docker pull nvcr.io/nvidia/l4t-pytorch:r34.1.1-pth1.12-py3
docker pull nvcr.io/nvidia/l4t-pytorch:r34.1.1-pth1.11-py3
1 Like

:-( ok. I will try. Dont like it but it might be neccesary.

Do you know if I will get performance issues with docker?

Hi, Thanks Dusty, That worked. I checked the versions of all components and noticed that there were residual old version of pytorch. After uninstalling them and verifying the local build of the latest branch of torchvision, I managed to get it running. So now I have it running outside of docker. It was really helpful to check the container for correctness and compare.

OK cool, glad that you were able to get it working @magnus.gabell

Docker isn’t a virtual machine, so it has same performance as if you were running it outside of container.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.