mdegans / nano_build_opencv

Build OpenCV on Nvidia Jetson Nano
MIT License
510 stars 200 forks source link

Unsupported gpu architecture 'compute_87' #74

Open drvrh opened 1 year ago

drvrh commented 1 year ago

Hello, I ran command $./build_opencv.sh on my Jetson Nano, but I get error:

[ 28%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o
nvcc fatal   : Unsupported gpu architecture 'compute_87'
CMake Error at cuda_compile_1_generated_gpu_mat.cu.o.RELEASE.cmake:221 (message):
  Error generating
  /tmp/build_opencv/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o

modules/core/CMakeFiles/opencv_core.dir/build.make:63: recipe for target 'modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o' failed
make[2]: *** [modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o] Error 1
CMakeFiles/Makefile2:2792: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

What's wrong?

chunyianliew commented 1 year ago

The latest Linux version supporting the Jetson Nano is Jetson Linux 32.7.3: https://developer.nvidia.com/embedded/jetson-linux-archive

The nvcc version included up to Jetson Linux 32.7.3 does not support the Nvidia Ampere GPU Architecture for Orin (compute_87): https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#virtual-architecture-feature-list

The Jetson Nano is based on the Maxwell Architecture (CUDA Architecture Version 5.3)

You can resolve this issue by changing line 110 in build_opencv.sh From
-D CUDA_ARCH_BIN=5.3,6.2,7.2,8.7 To
-D CUDA_ARCH_BIN=5.3