Jetson Orin Nano (JetPack 5.x): torchvision C++ ops (_C) fail to load with PyTorch 2.0.0+nv23.05

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:

  1. Installed PyTorch using the official NVIDIA wheel:
    torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl

  2. 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 .
  3. Verified that Python is importing the installed torchvision (not source tree):
    torchvision.file points to ~/.local/lib/python3.8/site-packages/torchvision/init.py

  4. 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:

  1. Is there an official torchvision build compatible with torch-2.0.0+nv23.05 for JetPack 5.x?
  2. Is there a recommended way to build torchvision so that torchvision._C exports PyInit__C correctly on Jetson?
  3. 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.

Hi @AnnaT ,

You can find the TorchVision installation steps in the below topic:
https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-11-now-available/72048

Installation

torchvision

If you want to build from source: PyTorch for Jetson

Build From Source

Basically, You just needs to set that one flag (e.g., export TORCH_CUDA_ARCH_LIST="8.7" ), and the compilation on the device will work perfectly. Please do refer to above mentioned KBs.

Thanks.