Hello NVIDIA team,
I am working on a Jetson Orin Nano with JetPack 5.x (L4T R35.x) and I am facing a reproducible issue with torchvision C++ extensions when using the official NVIDIA PyTorch build.
System:
- Device: Jetson Orin Nano
- JetPack: 5.x (R35.5.0)
- Python: 3.8.10
- CUDA: from JetPack
- PyTorch: torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl (official NVIDIA wheel)
PyTorch works correctly:
- torch.cuda.is_available() == True
- GPU is detected correctly
Problem:
torchvision C++ ops fail to load. Importing torchvision._C results in:
ImportError: dynamic module does not define module export function (PyInit__C)
This causes failures in libraries relying on torchvision.ops (e.g. YOLOv5 NMS).
Steps I followed:
-
Installed PyTorch using the official NVIDIA wheel:
torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl -
Built torchvision from source to match PyTorch 2.0.x:
- torchvision v0.15.1
- python3-dev / python3.8-dev installed
- build with:
python3.8 -m pip install --user --no-build-isolation --no-deps .
-
Verified that Python is importing the installed torchvision (not source tree):
torchvision.file points to ~/.local/lib/python3.8/site-packages/torchvision/init.py -
Import results:
import torchvision → OK
import torchvision._C → FAIL
Error: dynamic module does not define module export function (PyInit__C)
This suggests the C++ extension is being built with an incorrect Python ABI or init symbol, despite using python3.8 and python3.8-dev explicitly.
Questions:
- Is there an official torchvision build compatible with torch-2.0.0+nv23.05 for JetPack 5.x?
- Is there a recommended way to build torchvision so that torchvision._C exports PyInit__C correctly on Jetson?
- Are there additional build flags or environment variables required for torchvision when using NVIDIA PyTorch wheels?
Any guidance or official recommendation would be greatly appreciated.
Thank you.