cupy problem ZED x ZED box mini orin NX

Hi, I’m trying to run the hello_zed_gpu.py, and when I install the cupy (pip install cupy-cuda12x) and run it I get this:
(ZED) user@GTW-ONX1-D255TA0B:~/zed-sdk/tutorials/tutorial 1 - hello ZED/python$ python hello_zed_gpu.py
:white_check_mark: CuPy detected - GPU acceleration available
CuPy version: 14.1.1
CUDA version: 12090
ZED SDK CuPy Integration Test

Opening ZED camera…
[2026-06-18 10:50:29 UTC][ZED][INFO] Logging level INFO
[2026-06-18 10:50:30 UTC][ZED][INFO] Using GMSL input… Switched to default resolution HD1200
[2026-06-18 10:50:31 UTC][ZED][INFO] [Init] Camera FW version: 2001
[2026-06-18 10:50:31 UTC][ZED][INFO] [Init] Video mode: HD1200@30
[2026-06-18 10:50:31 UTC][ZED][INFO] [Init] Serial Number: S/N 48966519
[2026-06-18 10:50:31 UTC][ZED][INFO] [Init] Depth mode selected: NEURAL. Ensure this mode matches your application’s performance and accuracy requirements. See Depth Modes | StereoLabs for help.
ZED camera opened successfully.
Retrieving image data…
Retrieved image on GPU: 1920x1200

:test_tube: Testing GPU image processing (basic grayscale conversion)…

Input image: (1200, 1920, 4)
Processed image: (1200, 1920)
:white_check_mark: GPU processing test passed!

:floppy_disk: Testing memory allocation strategies…
CPU allocation: (480, 640, 4), float32

:cross_mark: Test suite failed: CURAND_STATUS_INITIALIZATION_FAILED

How can I fix it?

Hi @OscarSimetria
Welcome to the StereoLabs community.

:white_check_mark: GPU processing test passed! … :cross_mark: Test suite failed: CURAND_STATUS_INITIALIZATION_FAILED

Thanks for the detailed log, it actually points straight at the cause. Notice that everything up to and including the grayscale conversion works: the camera opens, the image is retrieved on the GPU, and the simple processing test passes. Those steps run inside the ZED SDK’s own CUDA context and use plain CuPy array slicing, so they don’t exercise cuRAND. The failure appears only at the memory-allocation test, which is the first step that calls into cuRAND (curandCreateGenerator). That is the tell.

The root cause is the CuPy package you installed. pip install cupy-cuda12x pulls the generic PyPI wheel, which bundles its own set of CUDA libraries built for desktop/server x86_64 GPUs. On a ZED Box Mini (Jetson Orin NX, aarch64, L4T/JetPack), CUDA is provided by JetPack itself, and the bundled cuRAND in that wheel does not initialize correctly against the Tegra driver, hence CURAND_STATUS_INITIALIZATION_FAILED. CuPy 14.1.1 reporting “CUDA version: 12090” confirms it loaded the wheel’s bundled stack rather than your JetPack CUDA.

The fix is to use a CuPy that links against the JetPack CUDA on the device instead of the prebuilt wheel:

  1. Remove the wrong package (inside your ZED venv):
   pip uninstall cupy-cuda12x cupy
  1. Confirm your JetPack CUDA major version:
   nvcc --version

On current Orin NX images this is CUDA 12.x.

  1. Install CuPy built from source against the on-device CUDA, so it links the JetPack cuRAND:
   export CUDA_PATH=/usr/local/cuda
   export PATH=$CUDA_PATH/bin:$PATH
   pip install --no-cache-dir cupy

This compiles CuPy against the Tegra CUDA libraries. The build takes a while on Orin NX; if it is slow, increasing the active power mode (sudo nvpmodel -m 0 then sudo jetson_clocks) helps.

  1. Re-run and verify the right libraries are picked up:
   python -c "import cupy; cupy.show_config()"
   python hello_zed_gpu.py

show_config() should report your JetPack CUDA path, and the cuRAND step will then initialize.

Quick sanity check first, if you want to isolate it in one line:

python -c "import cupy as cp; print(cp.random.rand(4))"

If that throws the same cuRAND error, it confirms the wheel mismatch rather than anything ZED-side.

For reference: ZED SDK download (ZED SDK 5.4 - Download | Stereolabs) and the Python API install guide (Install the ZED Python API | StereoLabs). Product pages for your hardware: ZED Box Mini (ZED Box Mini | Stereolabs) and the ZED X camera (ZED X - AI Stereo Camera for Robotics | Stereolabs).

Let me know your exact JetPack/L4T version (cat /etc/nv_tegra_release) if rebuilding CuPy still gives trouble, and I’ll follow up.

Hi @Myzhar

Thanks for your help.

I followed the steps you mentioned but I get the same error:

(ZED) user@GTW-ONX1-D255TA0B:~$    pip uninstall cupy-cuda12x cupy
Found existing installation: cupy-cuda12x 14.1.1
Uninstalling cupy-cuda12x-14.1.1:
Would remove:
/home/user/ZED/lib/python3.10/site-packages/cupy/*
/home/user/ZED/lib/python3.10/site-packages/cupy_backends/*
/home/user/ZED/lib/python3.10/site-packages/cupy_cuda12x-14.1.1.dist-info/*
/home/user/ZED/lib/python3.10/site-packages/cupyx/*
Proceed (Y/n)? y
Successfully uninstalled cupy-cuda12x-14.1.1
WARNING: Skipping cupy as it is not installed.

(ZED) user@GTW-ONX1-D255TA0B:~$ nvcc --version
bash: nvcc: command not found

(ZED) user@GTW-ONX1-D255TA0B:~$ export CUDA_PATH=/usr/local/cuda
export PATH=$CUDA_PATH/bin:$PATH
pip install --no-cache-dir cupy
Collecting cupy
Downloading cupy-14.1.1.tar.gz (4.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.0/4.0 MB 11.8 MB/s  0:00:00
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Requirement already satisfied: numpy<2.6,>=2.0 in ./ZED/lib/python3.10/site-packages (from cupy) (2.2.6)
Requirement already satisfied: cuda-pathfinder==1.*,>=1.3.4 in ./ZED/lib/python3.10/site-packages (from cupy) (1.5.5)
Building wheels for collected packages: cupy
Building wheel for cupy (pyproject.toml) … done
Created wheel for cupy: filename=cupy-14.1.1-cp310-cp310-linux_aarch64.whl size=108431510 sha256=08d8ce6540740f46f4e681f09ea5fcc2261b939cc2750a57edb389f9910db79c
Stored in directory: /tmp/pip-ephem-wheel-cache-y2juiwct/wheels/51/5e/93/6150e63565f16270409e4aef65a9cd242f44dd3696bf68b3d8
Successfully built cupy
Installing collected packages: cupy
Successfully installed cupy-14.1.1

(ZED) user@GTW-ONX1-D255TA0B:~$    python -c “import cupy; cupy.show_config()”
OS                           : Linux-5.15.148-tegra-aarch64-with-glibc2.35
Python Version               : 3.10.12
CuPy Version                 : 14.1.1
CuPy Platform                : NVIDIA CUDA
NumPy Version                : 2.2.6
SciPy Version                : 1.15.3
Cython Build Version         : 3.2.5
Cython Runtime Version       : 3.2.5
CUDA Root                    : /home/user/ZED/lib/python3.10/site-packages/nvidia/cu13
NVCC PATH                    : /usr/local/cuda/bin/nvcc
CUDA Build Version           : 12060
CUDA Driver Version          : 12060
CUDA Runtime Version         : 12060 (linked to CuPy) / 13000 (locally installed)
CUDA Extra Include Dirs      : [‘/home/user/ZED/lib/python3.10/site-packages/nvidia/cu13/include’]
cuBLAS Version               : (available)
cuFFT Version                : 11206
cuRAND Version               : 10400
cuSOLVER Version             : (11, 6, 4)
cuSPARSE Version             : (available)
NVRTC Version                : (13, 0)
Thrust Version               : 300102
CUB Build Version            : 300102
Jitify Build Version         : 
NCCL Build Version           : None
NCCL Runtime Version         : None
cuTENSOR Version             : None
cuSPARSELt Build Version     : None
Device 0 Name                : Orin
Device 0 Compute Capability  : 87
Device 0 PCI Bus ID          : 0000:00:00.0

(ZED) user@GTW-ONX1-D255TA0B:~$ cd zed-sdk/tutorials/tutorial\ 1
tutorial 10 - split process/   tutorial 12 - retrieve tensor/
tutorial 11 - health status/   tutorial 1 - hello ZED/
(ZED) user@GTW-ONX1-D255TA0B:~$ cd zed-sdk/tutorials/tutorial\ 1\ -\ hello\ ZED/
(ZED) user@GTW-ONX1-D255TA0B:~/zed-sdk/tutorials/tutorial 1 - hello ZED$ cd python/
(ZED) user@GTW-ONX1-D255TA0B:~/zed-sdk/tutorials/tutorial 1 - hello ZED/python$ python hello_zed_gpu.py
✅ CuPy detected - GPU acceleration available
CuPy version: 14.1.1
CUDA version: 12060
ZED SDK CuPy Integration Test

Opening ZED camera…
[2026-06-22 08:05:32 UTC][ZED][INFO] Logging level INFO
[2026-06-22 08:05:32 UTC][ZED][INFO] Using GMSL input… Switched to default resolution HD1200
[2026-06-22 08:05:34 UTC][ZED][INFO] [Init]  Camera FW version: 2001
[2026-06-22 08:05:34 UTC][ZED][INFO] [Init]  Video mode: HD1200@30
[2026-06-22 08:05:34 UTC][ZED][INFO] [Init]  Serial Number: S/N 48966519
[2026-06-22 08:05:34 UTC][ZED][INFO] [Init]  Depth mode selected: NEURAL. Ensure this mode matches your application’s performance and accuracy requirements. See 
 for help.
[2026-06-22 08:05:34 UTC][ZED][WARNING] [Init]  Self-calibration was skipped due to low texture or occlusion in the scene. Tracking accuracy may be affected.
ZED camera opened successfully.
Retrieving image data…
Retrieved image on GPU: 1920x1200

🧪 Testing GPU image processing (basic grayscale conversion)…
Input image: (1200, 1920, 4)
Processed image: (1200, 1920)
✅ GPU processing test passed!

💾 Testing memory allocation strategies…
CPU allocation: (480, 640, 4), float32

❌ Test suite failed: CURAND_STATUS_INITIALIZATION_FAILED

I get this with the isolate test:
(ZED) user@GTW-ONX1-D255TA0B:~/zed-sdk/tutorials/tutorial 1 - hello ZED/python$ python -c “import cupy as cp; print(cp.random.rand(4))”
Traceback (most recent call last):
File “”, line 1, in
File “/home/user/ZED/lib/python3.10/site-packages/cupy/random/_sample.py”, line 46, in rand
return random_sample(size=size, dtype=dtype)
File “/home/user/ZED/lib/python3.10/site-packages/cupy/random/_sample.py”, line 157, in random_sample
rs = _generator.get_random_state()
File “/home/user/ZED/lib/python3.10/site-packages/cupy/random/_generator.py”, line 1359, in get_random_state
rs = RandomState(seed)
File “/home/user/ZED/lib/python3.10/site-packages/cupy/random/_generator.py”, line 84, in init
self._generator = curand.createGenerator(method)
File “cupy_backends/cuda/libs/curand.pyx”, line 95, in cupy_backends.cuda.libs.curand.createGenerator
File “cupy_backends/cuda/libs/curand.pyx”, line 99, in cupy_backends.cuda.libs.curand.createGenerator
File “cupy_backends/cuda/libs/curand.pyx”, line 88, in cupy_backends.cuda.libs.curand.check_status
cupy_backends.cuda.libs.curand.CURANDError: CURAND_STATUS_INITIALIZATION_FAILED

This is my JetPack information:

cat /etc/nv_tegra_release

R36 (release), REVISION: 4.7, GCID: 42132812, BOARD: generic, EABI: aarch64, DATE: Thu Sep 18 22:54:44 UTC 2025

KERNEL_VARIANT: oot

TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia

Thank you in advance!!

Hi @OscarSimetria
It looks like you have two versions of CUDA installed on your device, which is not expected with a Jetson device.

You could try to uninstall everything you manually installed and then reinstall the ZED SDK, which installs all the required dependencies, avoiding any kind of conflict.
However, this procedure is not recommended because you could uninstall required libraries or leave unrequired.

I instead recommend you reflash the ZED Box from scratch and reinstall the ZED X Driver and the ZED SDK as explained here:

In this ways you are sure that you have a stable development system.

Thanks!!! This solved my problem.

1 Like