| Environment | Version |
|---|---|
| JetPack | 6.2.1 |
| Ubuntu | 22.04 Jammy |
| CUDA | 12.6.68 |
| cuDNN | 9.3.0.75 |
| VPI | 3.2.4 |
| Vulkan | 1.3.204 |
| Python | 3.10.12 |
| OpenCV | 4.11.0 with CUDA: YES |
| PyTorch | 2.5.0 (torchvision 0.23.0) |
| TensorRT | 10.3.0 |
Suggestion: Use
jtopto check the system config.
Before configuring the environement, run sudo apt-get update and sudo apt-get upgrade at first.
1. Python
- Use
minicondato manage python version. - Run
conda create --name xxx python=3.10to create virtual env
2. Ultralytics (YOLO)
- Install ultralytics dependencies:
pip install ultralytics - Uninstall
torchandtorchvisionfor they'recpuversion:pip uninstall torch torchvision(See belows) - Reinstall
numpyfor its too-high version:pip install "numpy<2" --force-reinstall
3. OpenCV
-
Install nano / orin:
sudo apt-get install nanoDon't worry it's also compatible with
orin nx -
Install dphys-swapfile:
sudo apt-get install dphys-swapfile -
Enlarge the boundary of CONF_MAXSWAP:
sudo nano /sbin/dphys-swapfile -
Restart the nano / orin:
sudo reboot -
Check memory:
free -m -
Run automator script OpenCV-4-11-0.sh:
- Grant permissions:
sudo chmod 755 ./OpenCV-4-11-0.sh - Run:
./OpenCV-4-11-0.sh
- Grant permissions:
-
Then check the installation of
opencv-cuda-versionis okayThanks to Q-engineering I finally did it!
4. Pytorch
- Uninstall cpu-pytorch:
sudo apt-get uninstall pytorch - Install gpu-pytorch from a prebuild wheel:
pip install https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.5.0a0+872d972e41.nv24.08-cp310-cp310-linux_aarch64.whl
See Resources Pytorch for Jetson
5. TensorRT
- Install tensorrt from a prebuild wheel:
pip install https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.20.0a0+afc54f7-cp310-cp310-linux_aarch64.whl
See Resources TensorRT for Jetson
6. ONNX
- The onnxruntime-gpu package hosted in PyPI does not have
aarch64binaries for the Jetson. So we need to manually install this package. - Install
onnxruntime-gpu: With Python3.10 on ourjetson orin nx, here we install onnxruntime-gpu 1.20.0 by:
pip install https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.20.0-cp310-cp310-linux_aarch64.whl
[1] YOLO Official Web: Ultralytics YOLO Docs
[2] Robomaster Support: Robomaster SDK Ultra
[3] Training on Intel Arc GPU: intel-extension-for-pytorch & ultralytics issue #19821