Hi Nvidia Team,
I am trying to enable CUDA for OpenCV building from source (the Debian way of building) and also doing the cross-compile from the powerful server. I am cross compiling OpenCV for Jetson Orin Nano platform.
rules.txt (8.8 KB)
I have attached the rules file, which is getting used during the configuration & building of OpenCV.
So, I am suspecting the NVCC build is taking more time during the build, due to which this package might fail. I have used -DCUDA_NVCC_FLAGS=“–threads 32” but I am not sure if any other parameters also need to be passed in OpenCV. Also, I am using 32 threads here. I need to increase this or decrease it to get better build speed.
Please help me to review the Debian rules file once and update me on what I have to use to get a better build speed and will not get a problem like this.
[1312/1355] : && /usr/bin/aarch64-linux-gnu-g++ -fPIC -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-undef -Wno-missing-declarations -Wno-shadow -Wno-strict-aliasing -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libopencv_cudaobjdetect.so.410 -o lib/libopencv_cudaobjdetect.so.4.10.0 modules/cudaobjdetect/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_hog.cu.o modules/cudaobjdetect/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_lbp.cu.o modules/cudaobjdetect/CMakeFiles/opencv_cudaobjdetect.dir/src/cascadeclassifier.cpp.o modules/cudaobjdetect/CMakeFiles/opencv_cudaobjdetect.dir/src/hog.cpp.o -L/usr/local/cuda/lib64 lib/libopencv_cudawarping.so.4.10.0 lib/libopencv_cudalegacy.so.4.10.0 -ldl -lm -lpthread -lrt -lcudart_static -ldl -lrt -lnppc -lnppial -lnppicc -lnppidei -lnppif -lnppig -lnppim -lnppist -lnppisu -lnppitc -lnpps -lcublas -lcufft -L/usr/local/cuda/lib64 -L/usr/lib/aarch64-linux-gnu -lcudart_static -ldl -lrt -lnppc -lnppial -lnppicc -lnppidei -lnppif -lnppig -lnppim -lnppist -lnppisu -lnppitc -lnpps lib/libopencv_cudaimgproc.so.4.10.0 lib/libopencv_cudafilters.so.4.10.0 lib/libopencv_cudaarithm.so.4.10.0 lib/libopencv_objdetect.so.4.10.0 lib/libopencv_video.so.4.10.0 lib/libopencv_dnn.so.4.10.0 lib/libopencv_calib3d.so.4.10.0 lib/libopencv_features2d.so.4.10.0 lib/libopencv_flann.so.4.10.0 lib/libopencv_imgproc.so.4.10.0 lib/libopencv_core.so.4.10.0 lib/libopencv_cudev.so.4.10.0 -lm -lpthread -lcublas -lcufft -Wl,-rpath-link,/<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/lib && :
[1313/1355] /usr/bin/cmake -E cmake_symlink_library lib/libopencv_cudaobjdetect.so.4.10.0 lib/libopencv_cudaobjdetect.so.410 lib/libopencv_cudaobjdetect.so && :
E: Build killed with signal TERM after 150 minutes of inactivity
--------------------------------------------------------------------------------
Build finished at 2025-02-25T23:15:15Z
+------------------------------------------------------------------------------+
| Finished Timed Build Commands |
+------------------------------------------------------------------------------+
rm -f /var/cache/apt/archives/sbuild-build-depends-main-dummy_*.deb
-------------------------------------------------------------------
I: Finished running 'rm -f /var/cache/apt/archives/sbuild-build-depends-main-dummy_*.deb'.
find /var/cache/apt/archives -maxdepth 1 -type f -name '*.deb' -print -exec cp -Ln --no-preserve=owner -t /home/builder/opencv/rootfs/var/cache/apt/archives/ {} +
------------------------------------------------------------------------------------------------------------------------------------------------------------------
I: Finished running 'find /var/cache/apt/archives -maxdepth 1 -type f -name '*.deb' -print -exec cp -Ln --no-preserve=owner -t /home/builder/opencv/rootfs/var/cache/apt/archives/ {} +'.
cp /var/log/dpkg.log /home/builder/opencv/rootfs/dpkg_partial.log
-----------------------------------------------------------------
I: Finished running 'cp /var/log/dpkg.log /home/builder/opencv/rootfs/dpkg_partial.log'.
Finished processing commands.
--------------------------------------------------------------------------------
Finished
--------
+------------------------------------------------------------------------------+
| Cleanup |
+------------------------------------------------------------------------------+
Purging /<<BUILDDIR>>
Not cleaning session: cloned chroot in use
E: Build failure (dpkg-buildpackage died)
+------------------------------------------------------------------------------+
| Summary |
+------------------------------------------------------------------------------+
Build Architecture: amd64
Build Profiles: cross cross
Build Type: binary
Build-Space: 12672448
Build-Time: 16492
Distribution: isar
Fail-Stage: build
Foreign Architectures: armhf arm64
Host Architecture: arm64
Install-Time: 115
Job: /build/tmp/work/industrial-os-arm64/opencv/4.10.0-ind1/opencv_4.10.0+dfsg-1.dsc
Machine Architecture: amd64
Package: opencv
Package-Time: 16617
Source-Version: 4.10.0+dfsg-1
Space: 12672448
Status: attempted
Version: 4.10.0+dfsg-1
--------------------------------------------------------------------------------
Finished at 2025-02-25T23:15:15Z
Build needed 04:36:57, 12672448k disk space
E: Build failure (dpkg-buildpackage died)
WARNING: exit code 2 from a shell command.
DEBUG: Executing shell function schroot_delete_configs
Removing /etc/schroot/mel-builder-ac991f03-882f-47ca-8d1d-a58ec9d16530-44938
Removing /etc/schroot/chroot.d/mel-builder-ac991f03-882f-47ca-8d1d-a58ec9d16530-44938
DEBUG: Shell function schroot_delete_configs finished
DEBUG: Python function do_dpkg_build finished