jetson-inference icon indicating copy to clipboard operation
jetson-inference copied to clipboard

new problem about compiling on x86_64 PC

Open Kokoing123 opened this issue 3 years ago • 5 comments

my env list follow this: GTX16050TI CUDA 10.2 TensorRT 7.1.3 Cudnn 8.0

The problem was: [ 38%] Building CXX object utils/CMakeFiles/jetson-utils.dir/video/videoOptions.cpp.o [ 38%] Building CXX object utils/CMakeFiles/jetson-utils.dir/video/videoOutput.cpp.o [ 39%] Building CXX object utils/CMakeFiles/jetson-utils.dir/video/videoSource.cpp.o [ 40%] Linking CXX shared library ../x86_64/lib/libjetson-utils.so /usr/bin/ld: could not find -lnvbuf_utils collect2: error: ld returned 1 exit status utils/CMakeFiles/jetson-utils.dir/build.make:1134: recipe for target 'x86_64/lib/libjetson-utils.so' failed make[2]: *** [x86_64/lib/libjetson-utils.so] Error 1 CMakeFiles/Makefile2:758: recipe for target 'utils/CMakeFiles/jetson-utils.dir/all' failed make[1]: *** [utils/CMakeFiles/jetson-utils.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

emmm, could you tell something about this problem?

Kokoing123 avatar Dec 04 '21 14:12 Kokoing123

Hi @Kokoing123, nvbuf_utils is a library that is only available for Jetson. You would need to remove it from the various CMakeLists and compile with cmake -DENABLE_NVMM=off

Also, I only build this project for Jetson, I don't officially support x86 for it

dusty-nv avatar Dec 06 '21 14:12 dusty-nv

Modify the following line in /utils/CMakeLists.txt target_link_libraries(jetson-utils GL GLU GLEW gstreamer-1.0 gstapp-1.0 gstpbutils-1.0 nvbuf_utils ${CUDA_nppicc_LIBRARY}) to target_link_libraries(jetson-utils GL GLU GLEW gstreamer-1.0 gstapp-1.0 gstpbutils-1.0 ${CUDA_nppicc_LIBRARY})

If you get policy CMP0079 or CMP0002 errors while compiling add the following to your CMakeList files:

cmake_policy(SET CMP0002 OLD)

Also make sure that your GPU is added to the root CMakeLists.txt architecture list, for example if you want to run it on a RTX3070 add: -gencode arch=compute_86,code=sm_86

And ofcourse compile with the cmake -DENABLE_NVMM=off command

voidzero666 avatar Mar 03 '22 09:03 voidzero666

Hi, I am having the same issue so I tried this solution. However, I am getting the following error:

$ make -j$(nproc) ........... CMakeFiles/Makefile2:367: recipe for target 'examples/detectnet/CMakeFiles/detectnet-camera.dir/all' failed make[1]: *** [examples/detectnet/CMakeFiles/detectnet-camera.dir/all] Error 2 ../../x86_64/lib/libjetson-utils.so: undefined reference to NvBufferGetParams' ../../x86_64/lib/libjetson-utils.so: undefined reference to NvDestroyEGLImage' ../../x86_64/lib/libjetson-utils.so: undefined reference to ExtractFdFromNvBuffer' ../../x86_64/lib/libjetson-utils.so: undefined reference to NvReleaseFd' ../../x86_64/lib/libjetson-utils.so: undefined reference to `NvEGLImageFromFd' collect2: error: ld returned 1 exit status examples/detectnet/CMakeFiles/detectnet.dir/build.make:101: recipe for target 'x86_64/bin/detectnet' failed make[2]: *** [x86_64/bin/detectnet] Error 1 CMakeFiles/Makefile2:405: recipe for target 'examples/detectnet/CMakeFiles/detectnet.dir/all' failed make[1]: *** [examples/detectnet/CMakeFiles/detectnet.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

FYI, my env list is as follows: GTX16050 CUDA 10.0 TensorRT 7.0

I know the package is built for the Jetson platform, but I need this repo to run another project (this is a dependency). I'd appreciate your response. Thank you!

riziamm avatar Mar 25 '22 17:03 riziamm

Are you sure that you built with cmake -DENABLE_NVMM=off ? Those functions shouldn't be used if that is turned off.

dusty-nv avatar Mar 25 '22 21:03 dusty-nv

Hi, Yes. I did the following. But it worked this time, after removing the old repo and restarting my system, and making a clean build. Here are the steps for reference:

  • I added my GPU to the root CMakeLists.txt architecture list,
  • I removed 'nvbuf_utils' from /utils/CMakeLists.txt target_link_libraries(jetson-utils GL GLU GLEW gstreamer-1.0 gstapp-1.0 gstpbutils-1.0 nvbuf_utils ${CUDA_nppicc_LIBRARY}) to target_link_libraries(jetson-utils GL GLU GLEW gstreamer-1.0 gstapp-1.0 gstpbutils-1.0 ${CUDA_nppicc_LIBRARY})
  • $ cmake -DENABLE_NVMM=off ../
  • $ make -j$(nproc)

Thanks a lot for your prompt reply.

riziamm avatar Mar 25 '22 22:03 riziamm