Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compiling in container AGX - cmake:3.2 JP:4.5 #267

Open
masip85 opened this issue Oct 7, 2021 · 2 comments
Open

Not compiling in container AGX - cmake:3.2 JP:4.5 #267

masip85 opened this issue Oct 7, 2021 · 2 comments

Comments

@masip85
Copy link

masip85 commented Oct 7, 2021

Can't upgrade to cmake3.5 in arm64 and ubuntu 18. This is what happens with the project with cmake 3.2. For using it, I've used commit 62e4a3f for this repositoy, the one before you changed the minimum version of cmake.

Also:
cuda: 10.2
cudnn: 8.0.0.180
tensor rt: 7.1.3-1+cuda10.2"
opencv: "4.5.2"
os: ubuntu 18 - arm 64
This is obtained with jetson-pack 4.6 jetson agx installation, but using using nvidia self contained l4t images:

l4t-cuda:10.2.460-runtime
The CUDA runtime container image is intended to be used as a base image to containerize and deploy CUDA applications on Jetson and includes CUDA runtime and CUDA math libraries included in it; these components does not get mounted from host by NVIDIA container runtime. NVIDIA container rutime still mounts platform specific libraries and select device nodes into the container.

Then, I install fron nvidia debian repositories cudnn and tensorrt always using jetpack 4.4 nvidia debian repository reference.
And then next error is dropped when compiling tkdnn:

[ 23%] Building CXX object CMakeFiles/tkDNN.dir/src/Conv2d.cpp.o
In file included from /tmp/install_tkdnn/tkDNN/include/tkDNN/Layer.h:6:0,
                 from /tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:3:
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp: In member function 'void tk::dnn::Conv2d::initCUDNN(bool)':
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:68:57: **error: 'CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST' was not declared in this scope**
                                                         CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST, 0, &bwAlgo) );
                                                         ^
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:66:9: note: in expansion of macro 'checkCUDNN'
         checkCUDNN( cudnnGetConvolutionBackwardDataAlgorithm(net->cudnnHandle,
         ^~~~~~~~~~
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:68:57: note: suggested alternative: 'CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT'
                                                         CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST, 0, &bwAlgo) );
                                                         ^
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:66:9: note: in expansion of macro 'checkCUDNN'
         checkCUDNN( cudnnGetConvolutionBackwardDataAlgorithm(net->cudnnHandle,
         ^~~~~~~~~~
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:66:21: error: 'cudnnGetConvolutionBackwardDataAlgorithm' was not declared in this scope
         checkCUDNN( cudnnGetConvolutionBackwardDataAlgorithm(net->cudnnHandle,
                     ^
/tmp/install_tkdnn/tkDNN/include/tkDNN/utils.h:68:9: note: in definition of macro 'checkCUDNN'
     if (status != CUDNN_STATUS_SUCCESS) {                              \
         ^~~~~~
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:66:21: note: suggested alternative: 'cudnnGetConvolutionBackwardDataAlgorithm_v7'
         checkCUDNN( cudnnGetConvolutionBackwardDataAlgorithm(net->cudnnHandle,
                     ^
/tmp/install_tkdnn/tkDNN/include/tkDNN/utils.h:68:9: note: in definition of macro 'checkCUDNN'
     if (status != CUDNN_STATUS_SUCCESS) {                              \
         ^~~~~~
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:79:57: error: 'CUDNN_CONVOLUTION_FWD_PREFER_FASTEST' was not declared in this scope
                                                         CUDNN_CONVOLUTION_FWD_PREFER_FASTEST, 0, &algo) );
                                                         ^
/tmp/install_tkdnn/tkDNN/include/tkDNN/utils.h:68:9: note: in definition of macro 'checkCUDNN'
     if (status != CUDNN_STATUS_SUCCESS) {                              \
         ^~~~~~
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:79:57: note: suggested alternative: 'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3'
                                                         CUDNN_CONVOLUTION_FWD_PREFER_FASTEST, 0, &algo) );
                                                         ^
/tmp/install_tkdnn/tkDNN/include/tkDNN/utils.h:68:9: note: in definition of macro 'checkCUDNN'
     if (status != CUDNN_STATUS_SUCCESS) {                              \
         ^~~~~~
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:77:21: error: 'cudnnGetConvolutionForwardAlgorithm' was not declared in this scope
         checkCUDNN( cudnnGetConvolutionForwardAlgorithm(net->cudnnHandle,
                     ^
/tmp/install_tkdnn/tkDNN/include/tkDNN/utils.h:68:9: note: in definition of macro 'checkCUDNN'
     if (status != CUDNN_STATUS_SUCCESS) {                              \
         ^~~~~~
/tmp/install_tkdnn/tkDNN/src/Conv2d.cpp:77:21: note: suggested alternative: 'cudnnGetConvolutionForwardAlgorithm_v7'
         checkCUDNN( cudnnGetConvolutionForwardAlgorithm(net->cudnnHandle,
                     ^
/tmp/install_tkdnn/tkDNN/include/tkDNN/utils.h:68:9: note: in definition of macro 'checkCUDNN'
     if (status != CUDNN_STATUS_SUCCESS) {                              \
         ^~~~~~
make[2]: *** [CMakeFiles/tkDNN.dir/src/Conv2d.cpp.o] Error 1
CMakeFiles/tkDNN.dir/build.make:117: recipe for target 'CMakeFiles/tkDNN.dir/src/Conv2d.cpp.o' failed
CMakeFiles/Makefile2:625: recipe for target 'CMakeFiles/tkDNN.dir/all' failed
Makefile:135: recipe for target 'all' failed
make[1]: *** [CMakeFiles/tkDNN.dir/all] Error 2
make: *** [all] Error 2

Here is the cmake info:

HEAD is now at 62e4a3f memory release
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found suitable version "10.2", minimum required is "9.0") 
-- Found CUDNN: /usr/lib/aarch64-linux-gnu/libcudnn.so
-- Found NVINFER: /usr/lib/aarch64-linux-gnu/libnvinfer.so
-- Found OpenCV: /usr/local (found version "4.5.2") 
install dir:/usr/local
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/install_tkdnn/tkDNN/build
[  1%] Building NVCC (Device) object CMakeFiles/kernels.dir/src/kernels/kernels_generated_upsample.cu.o
....
@masip85 masip85 changed the title error: 'CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST was not declared in this scope Not compiling in container AGX - cmake:3.2 JP:4.5 Oct 7, 2021
@masip85
Copy link
Author

masip85 commented Oct 7, 2021

Ok, now I've seen the error was mine because of using that old commit. But with last version of the repo I've got this:

 39%] Linking CXX executable seg_demo
/usr/bin/ld: warning: libnvdla_compiler.so, needed by /usr/lib/aarch64-linux-gnu/libnvinfer.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libnvmedia.so, needed by /usr/lib/aarch64-linux-gnu/libnvinfer.so, not found (try using -rpath or -rpath-link)
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaGetMaxOutstandingTasks'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamConsumerDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamConsumerAcquireMetaData'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaEglStreamProducerGetTensor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaDataUnregister'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaGetOutputTensorDescriptor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `nvdla::destroyNetwork(nvdla::INetwork*)'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `nvdla::createWisdom()'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorGetMetaData'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaEglStreamProducerPostTensor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaAppendLoadable'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorGetStatus'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaDataRegister'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaLoadableCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `nvdla::destroyWisdom(nvdla::IWisdom*)'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaGetInputTensorDescriptor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamProducerCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDeviceDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamProducerDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamConsumerCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaInit'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorLock'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `nvdla::createNetwork()'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaSubmit'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaEglStreamConsumerAcquireTensor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaLoadLoadable'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaEglStreamConsumerReleaseTensor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaGetNumEngines'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamProducerPostMetaData'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDeviceCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaSetCurrentLoadable'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorUnlock'
collect2: error: ld returned 1 exit status
CMakeFiles/seg_demo.dir/build.make:170: recipe for target 'seg_demo' failed
make[2]: *** [seg_demo] Error 1
CMakeFiles/Makefile2:179: recipe for target 'CMakeFiles/seg_demo.dir/all' failed
make[1]: *** [CMakeFiles/seg_demo.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

I use the command in cmake:
cmake -D CUDA_cublas_LIBRARY=/usr/local/cuda-10.2/targets/aarch64-linux/lib/libcublas.so.10 ..
Because it doesn't compile without it.

First two warnings... Ive inspected the container a little previous compiling tkDNN:

root@agx1:/# ldd /usr/lib/aarch64-linux-gnu/libnvinfer.so | grep media
        libnvmedia.so => /usr/lib/aarch64-linux-gnu/tegra/libnvmedia.so (0x0000007f8cd73000)
root@agx1:/# ldd /usr/lib/aarch64-linux-gnu/libnvinfer.so | grep compiler
        libnvdla_compiler.so => /usr/lib/aarch64-linux-gnu/tegra/libnvdla_compiler.so (0x0000007f93765000)

Why do I get

/usr/bin/ld: warning: libnvdla_compiler.so, needed by /usr/lib/aarch64-linux-gnu/libnvinfer.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libnvmedia.so, needed by /usr/lib/aarch64-linux-gnu/libnvinfer.so, not found (try using -rpath or -rpath-link)

?

I add the cmake -LA in case it could help:

Cloning into 'tkDNN'...
CMake Warning (dev) at CMakeLists.txt:21:
  Syntax Warning in cmake code at column 30

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found suitable version "10.2", minimum required is "9.0") 
-- Found CUDNN: /usr/lib/aarch64-linux-gnu/libcudnn.so
-- Found CUDNN include: /usr/include
-- Found NVINFER: /usr/lib/aarch64-linux-gnu/libnvinfer.so
-- Found NVINFER include: /usr/include/aarch64-linux-gnu
-- Found CUDNN: /usr/lib/aarch64-linux-gnu/libcudnn.so  
Eigen DIR: /usr/include/eigen3
-- Found OpenCV: /usr/local (found version "4.5.2") 
install dir:/usr/local
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_LIBRARY (ADVANCED)
    linked by target "tkDNN" in directory /tmp/install_tkdnn/tkDNN
    linked by target "kernels" in directory /tmp/install_tkdnn/tkDNN

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
-- Cache values
CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line
CMAKE_AR:FILEPATH=/usr/bin/ar
CMAKE_BUILD_TYPE:STRING=
CMAKE_COLOR_MAKEFILE:BOOL=ON
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-7
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-7
CMAKE_CXX_FLAGS:STRING=
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-7
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-7
CMAKE_C_FLAGS:STRING=
CMAKE_C_FLAGS_DEBUG:STRING=-g
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
CMAKE_INSTALL_PREFIX:PATH=/usr/local
CMAKE_LINKER:FILEPATH=/usr/bin/ld
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_NM:FILEPATH=/usr/bin/nm
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
CMAKE_READELF:FILEPATH=/usr/bin/readelf
CMAKE_SHARED_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_STRIP:FILEPATH=/usr/bin/strip
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
CUDA_64_BIT_DEVICE_CODE:BOOL=ON
CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE:BOOL=ON
CUDA_BUILD_CUBIN:BOOL=OFF
CUDA_BUILD_EMULATION:BOOL=OFF
CUDA_CUDART_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcudart.so
CUDA_CUDA_LIBRARY:FILEPATH=CUDA_CUDA_LIBRARY-NOTFOUND
CUDA_GENERATED_OUTPUT_DIR:PATH=
CUDA_HOST_COMPILATION_CPP:BOOL=ON
CUDA_HOST_COMPILER:FILEPATH=/usr/bin/cc
CUDA_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda/bin/nvcc
CUDA_NVCC_FLAGS:STRING=
CUDA_NVCC_FLAGS_DEBUG:STRING=
CUDA_NVCC_FLAGS_MINSIZEREL:STRING=
CUDA_NVCC_FLAGS_RELEASE:STRING=
CUDA_NVCC_FLAGS_RELWITHDEBINFO:STRING=
CUDA_OpenCL_LIBRARY:FILEPATH=CUDA_OpenCL_LIBRARY-NOTFOUND
CUDA_PROPAGATE_HOST_FLAGS:BOOL=ON
CUDA_SDK_ROOT_DIR:PATH=CUDA_SDK_ROOT_DIR-NOTFOUND
CUDA_SEPARABLE_COMPILATION:BOOL=OFF
CUDA_TOOLKIT_INCLUDE:PATH=/usr/local/cuda/include
CUDA_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda
CUDA_USE_STATIC_CUDA_RUNTIME:BOOL=ON
CUDA_VERBOSE_BUILD:BOOL=OFF
CUDA_VERSION:STRING=10.2
CUDA_cublas_LIBRARY:FILEPATH=CUDA_cublas_LIBRARY-NOTFOUND
CUDA_cudadevrt_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcudadevrt.a
CUDA_cudart_static_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libcudart_static.a
CUDA_cufft_LIBRARY:FILEPATH=CUDA_cufft_LIBRARY-NOTFOUND
CUDA_cupti_LIBRARY:FILEPATH=CUDA_cupti_LIBRARY-NOTFOUND
CUDA_curand_LIBRARY:FILEPATH=CUDA_curand_LIBRARY-NOTFOUND
CUDA_cusolver_LIBRARY:FILEPATH=CUDA_cusolver_LIBRARY-NOTFOUND
CUDA_cusparse_LIBRARY:FILEPATH=CUDA_cusparse_LIBRARY-NOTFOUND
CUDA_nppc_LIBRARY:FILEPATH=CUDA_nppc_LIBRARY-NOTFOUND
CUDA_nppi_LIBRARY:FILEPATH=CUDA_nppi_LIBRARY-NOTFOUND
CUDA_nppial_LIBRARY:FILEPATH=CUDA_nppial_LIBRARY-NOTFOUND
CUDA_nppicc_LIBRARY:FILEPATH=CUDA_nppicc_LIBRARY-NOTFOUND
CUDA_nppicom_LIBRARY:FILEPATH=CUDA_nppicom_LIBRARY-NOTFOUND
CUDA_nppidei_LIBRARY:FILEPATH=CUDA_nppidei_LIBRARY-NOTFOUND
CUDA_nppif_LIBRARY:FILEPATH=CUDA_nppif_LIBRARY-NOTFOUND
CUDA_nppig_LIBRARY:FILEPATH=CUDA_nppig_LIBRARY-NOTFOUND
CUDA_nppim_LIBRARY:FILEPATH=CUDA_nppim_LIBRARY-NOTFOUND
CUDA_nppist_LIBRARY:FILEPATH=CUDA_nppist_LIBRARY-NOTFOUND
CUDA_nppisu_LIBRARY:FILEPATH=CUDA_nppisu_LIBRARY-NOTFOUND
CUDA_nppitc_LIBRARY:FILEPATH=CUDA_nppitc_LIBRARY-NOTFOUND
CUDA_npps_LIBRARY:FILEPATH=CUDA_npps_LIBRARY-NOTFOUND
CUDA_nvToolsExt_LIBRARY:FILEPATH=/usr/local/cuda/lib64/libnvToolsExt.so
CUDA_rt_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/librt.so
CUDNN_INCLUDE_DIR:PATH=/usr/include
CUDNN_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libcudnn.so
Eigen3_DIR:PATH=/usr/lib/cmake/eigen3
NVINFER_INCLUDE_DIR:PATH=/usr/include/aarch64-linux-gnu
NVINFER_LIBRARY:FILEPATH=/usr/lib/aarch64-linux-gnu/libnvinfer.so
OpenCV_DIR:PATH=/usr/local/lib/cmake/opencv4
yaml-cpp_DIR:PATH=/usr/lib/aarch64-linux-gnu/cmake/yaml-cpp

This also happens in a fresh install I've tested. I've flashed with jetpack 3.4, then, tried to

@masip85
Copy link
Author

masip85 commented Oct 10, 2021

This also happens in a fresh install with jetpack 4.4. Then I try to use this Dockerfile:

ARG BASE_IMAGE=nvcr.io/nvidia/l4t-base:r32.4.3

FROM ${BASE_IMAGE} as base

ENV OS=ubuntu1804
ENV ARCH=arm64
ARG SOC="t194"
# Cambiamos el repositorio de nvidia 32.6 de este container, 
# por el 32.5 para hacer un downgrade de tensorRT y cudnn
ARG JETPACK_VERSION="r32.4"

ARG OPENCV_VERSION="4.5.2"
ARG OPENCV_DO_TEST="FALSE"
ARG DEBIAN_FRONTEND=noninteractive


#8.2.4.15 #8.2.1.32
ENV NV_CUDNN_VERSION 8.0.0.180
ENV NV_CUDNN_PACKAGE_NAME libcudnn8
ENV NV_CUDNN_PACKAGE ${NV_CUDNN_PACKAGE_NAME}=${NV_CUDNN_VERSION}-1+cuda10.2
ENV NV_CUDNN_PACKAGE_DEV ${NV_CUDNN_PACKAGE_NAME}-dev=${NV_CUDNN_VERSION}-1+cuda10.2

ENV TRT_VERSION="7.1.3-1+cuda10.2"


# RUN wget https://developer.download.nvidia.com/compute/cuda/repos/${OS}/${ARCH}/cuda-${OS}.pin && \
#     apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/${OS}/${ARCH}/7fa2af80.pub && \
#     echo "deb https://developer.download.nvidia.com/compute/cuda/repos/${OS}/${ARCH}/ /" > /etc/apt/sources.list.d/nvidia-l4t-apt-source.list

# Adding Nvidia repositories
ADD --chown=root:root https://repo.download.nvidia.com/jetson/jetson-ota-public.asc /etc/apt/trusted.gpg.d/jetson-ota-public.asc
RUN chmod 644 /etc/apt/trusted.gpg.d/jetson-ota-public.asc \
   && apt-get update && apt-get install -y --no-install-recommends \
       ca-certificates 
RUN echo "deb https://repo.download.nvidia.com/jetson/common ${JETPACK_VERSION} main" > /etc/apt/sources.list.d/nvidia-l4t-apt-source.list \
   && echo "deb https://repo.download.nvidia.com/jetson/${SOC} ${JETPACK_VERSION} main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list \
  && cat /etc/apt/sources.list.d/nvidia-l4t-apt-source.list \
  && apt update
RUN apt update -y && apt upgrade -y



# Install cuDNN
#cuDNN dev necessary for compiling opencv and tkdnn
RUN apt install -y --no-install-recommends \
    ${NV_CUDNN_PACKAGE} \
    ${NV_CUDNN_PACKAGE_DEV} && \
    apt-mark hold ${NV_CUDNN_PACKAGE_NAME} 
#Install Tensor-RT 
# tensorRT-dev necessary for compiling tkdnn
RUN apt install -y  libnvinfer7=${TRT_VERSION} \
                    libnvonnxparsers7=${TRT_VERSION} \
                    libnvparsers7=${TRT_VERSION} \
                    libnvonnxparsers-dev=${TRT_VERSION} \
                    libnvparsers-dev=${TRT_VERSION} \
                    libnvinfer-plugin7=${TRT_VERSION} \
                    libnvinfer-plugin-dev=${TRT_VERSION} \
                    libnvinfer-dev=${TRT_VERSION} python-libnvinfer=${TRT_VERSION} \
                    python3-libnvinfer=${TRT_VERSION} 
RUN apt-mark hold libnvinfer7 libnvonnxparsers7 libnvparsers7 libnvinfer-plugin7 libnvinfer-dev libnvonnxparsers-dev libnvparsers-dev libnvinfer-plugin-dev python-libnvinfer python3-libnvinfer


# Update cmake for tkdnn compiling
RUN apt install gpg wget -y && \
    wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
    echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
    apt update -y && rm /usr/share/keyrings/kitware-archive-keyring.gpg && \  
    apt install kitware-archive-keyring  -y && \
    apt update -y && apt install cmake -y && cmake --version


# Install OPENCV

# Updating python to 3.8. This is optional, 
# but not possible nowadays with python3-libnvinfer dependencies (>3.6 & <3.7)
# RUN apt remove --purge python3.6 -y && apt autoremove -y && apt install python3.8 -y 
# RUN rm -f /usr/bin/python3 && ln -s /usr/bin/python3.8 /usr/bin/python3
# RUN rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python

# Required opencv compiling dependencies
RUN echo "Installing build dependencies." && \
    apt update && \
    apt dist-upgrade -y --autoremove && \
    apt install -y \
	build-essential \
	unzip \
	pkg-config \
	libjpeg-dev \
	libpng-dev \
	libtiff-dev \
	libavcodec-dev \
	libavformat-dev \
	libswscale-dev \
	libv4l-dev \
	libxvidcore-dev \
	libx264-dev \	
	libgtk-3-dev \
	libatlas-base-dev \
	gfortran \
	python3-dev \
   libgstreamer1.0-dev \
   libgstreamer-plugins-base1.0-dev \
   libdc1394-22-dev \
   libavresample-dev \
   libgstreamer1.0-dev \
   libgstreamer-plugins-base1.0-dev 
RUN apt install libeigen3-dev python3-numpy -y && python --version

RUN mkdir -p /tmp/install_cv2 && \
    cd /tmp/install_cv2 && \
    apt install git -y && \
    git clone --branch ${OPENCV_VERSION} --depth 1 https://github.com/opencv/opencv.git && \
    git clone --branch ${OPENCV_VERSION} --depth 1 https://github.com/opencv/opencv_contrib.git


RUN cd /tmp/install_cv2/opencv && mkdir build && cd build && \
    cmake -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs \
        -D BUILD_EXAMPLES=OFF \
        -D BUILD_opencv_python3=ON \
	     -D BUILD_opencv_python2=OFF \
        -D BUILD_opencv_java=OFF \
        -D PYTHON_EXECUTABLE='/usr/bin/python3' \
        -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_INSTALL_PREFIX=/usr/local/ \
        -D CUDA_ARCH_BIN=7.2 \
        -D CUDA_ARCH_PTX= \
        -D CUDA_FAST_MATH=ON \
        -D EIGEN_INCLUDE_PATH=/usr/include/eigen3 \
        -D ENABLE_NEON=ON \
        -D OPENCV_ENABLE_NONFREE=ON \
        -D OPENCV_EXTRA_MODULES_PATH=/tmp/install_cv2/opencv_contrib/modules \
        -D OPENCV_GENERATE_PKGCONFIG=ON \
        -D WITH_CUBLAS=ON \
        -D WITH_CUDA=ON \
        -D WITH_CUDNN=ON \
        -D OPENCV_DNN_CUDA=ON \
        -D WITH_GSTREAMER=ON \
        -D WITH_LIBV4L=ON \
	     -D WITH_NVCUVID=ON \
        ../
#         #-D CUDNN_LIBRARY=/usr/local/cuda/lib64/libcudnn_static_v8.a \
#         #-D CUDNN_INCLUDE_DIR=/usr/local/cuda/include \
#         #-D CUDNN_VERSION=${NV_CUDNN_VERSION} \
RUN cd /tmp/install_cv2/opencv/build && make -j3 VERBOSE=1
RUN cd /tmp/install_cv2/opencv/build && make install
RUN cd /tmp/install_cv2/opencv/build && ldconfig
RUN rm -rf /tmp/install_cv2 -rf


# Set environment and working directory
# ENV TRT_LIBPATH=/usr/lib/aarch64-linux-gnu/
# ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${TRT_LIBPATH}"

# Install tkDNN
RUN apt install libeigen3-dev libyaml-cpp-dev -y
ENV LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
RUN echo $LD_LIBRARY_PATH
RUN mkdir /tmp/install_tkdnn && cd /tmp/install_tkdnn && \
    git clone https://github.com/ceccocats/tkDNN && \
    cd tkDNN  && mkdir build  && cd build  && \
    cmake .. && \ 
    # CUDA_VERBOSE_BUILD
    #cmake -D CUDA_cublas_LIBRARY=/usr/local/cuda-10.2/targets/aarch64-linux/lib/libcublas.so.10 .. && \
   #  #       -D CUDA_nvinfer_LIBRARY.. && \ 
    make

Result:

[ 39%] Linking CXX executable seg_demo
/usr/bin/ld: warning: libnvrtc.so.10.2, needed by /usr/lib/aarch64-linux-gnu/libnvinfer.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libnvdla_compiler.so, needed by /usr/lib/aarch64-linux-gnu/libnvinfer.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libnvmedia.so, needed by /usr/lib/aarch64-linux-gnu/libnvinfer.so, not found (try using -rpath or -rpath-link)
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaGetMaxOutstandingTasks'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamConsumerDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamConsumerAcquireMetaData'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaEglStreamProducerGetTensor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaDataUnregister'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaGetOutputTensorDescriptor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `nvdla::destroyNetwork(nvdla::INetwork*)'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `nvdla::createWisdom()'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorGetMetaData'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaEglStreamProducerPostTensor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaAppendLoadable'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorGetStatus'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaDataRegister'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaLoadableCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `nvdla::destroyWisdom(nvdla::IWisdom*)'
/usr/lib/aarch64-linux-gnu/libmyelin.so.1: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaGetInputTensorDescriptor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamProducerCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDeviceDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamProducerDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamConsumerCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaInit'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorLock'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `nvdla::createNetwork()'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaSubmit'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaEglStreamConsumerAcquireTensor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaLoadLoadable'
/usr/lib/aarch64-linux-gnu/libmyelin.so.1: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaEglStreamConsumerReleaseTensor'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaGetNumEngines'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaDestroy'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorEglStreamProducerPostMetaData'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDeviceCreate'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaDlaSetCurrentLoadable'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `NvMediaTensorUnlock'
/usr/lib/aarch64-linux-gnu/libnvinfer.so: undefined reference to `[email protected]'
collect2: error: ld returned 1 exit status
CMakeFiles/seg_demo.dir/build.make:170: recipe for target 'seg_demo' failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant