davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++
http://dlib.net
Boost Software License 1.0
13.51k stars 3.37k forks source link

[Bug]version libcudnn_ops_infer.so.8 not defined in file libcudnn_ops_infer.so.8 #2719

Closed dentistfrankchen closed 1 year ago

dentistfrankchen commented 1 year ago

Now I am using Amazon sagemaker to do some work related to video. The cpu version of glib is kind of laggy so I decided to compile gpu version of glib. I cloned glib from github by git clone https://github.com/davisking/dlib.git and used python setup.py install with no other changes. The compile process seemed fine and I got glib installed. Here's my compiling process. It seems to be normal: python setup.py install running install /home/ec2-user/anaconda3/envs/art_intel/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /home/ec2-user/anaconda3/envs/art_intel/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info creating tools/python/dlib.egg-info writing tools/python/dlib.egg-info/PKG-INFO writing dependency_links to tools/python/dlib.egg-info/dependency_links.txt writing top-level names to tools/python/dlib.egg-info/top_level.txt writing manifest file 'tools/python/dlib.egg-info/SOURCES.txt' reading manifest file 'tools/python/dlib.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'tools/python/build' no previously-included directories found matching 'dlib/cmake_utils//build' warning: no previously-included files matching '.pyc' found anywhere in distribution adding license file 'LICENSE.txt' writing manifest file 'tools/python/dlib.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext Building extension for Python 3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 15:55:03) Invoking CMake setup: 'cmake /home/ec2-user/SageMaker/users/install dlib with cuda/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/ec2-user/SageMaker/users/install dlib with cuda/dlib/build/lib.linux-x86_64-cpython-39 -DPYTHON_EXECUTABLE=/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python -DCMAKE_BUILD_TYPE=Release' -- The C compiler identification is GNU 7.3.1 -- The CXX compiler identification is GNU 7.3.1 -- 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 -- pybind11 v2.10.0 -- Found PythonInterp: /home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python (found suitable version "3.9.15", minimum required is "3.6") -- Found PythonLibs: /home/ec2-user/anaconda3/envs/art_intel/lib/libpython3.9.so -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Using CMake version: 3.24.2 -- Compiling dlib version: 19.24.99 -- SSE4 instructions can be executed by the host processor. -- AVX instructions can be executed by the host processor. -- Enabling AVX instructions -- 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 X11: /home/ec2-user/anaconda3/include
-- Looking for XOpenDisplay in /home/ec2-user/anaconda3/lib/libX11.so;/home/ec2-user/anaconda3/lib/libXext.so -- Looking for XOpenDisplay in /home/ec2-user/anaconda3/lib/libX11.so;/home/ec2-user/anaconda3/lib/libXext.so - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for connect -- Looking for connect - found -- Looking for remove -- Looking for remove - found -- Looking for shmat -- Looking for shmat - found -- Looking for IceConnectionNumber in ICE -- Looking for IceConnectionNumber in ICE - found CMake Warning at /home/ec2-user/SageMaker/users/install dlib with cuda/dlib/dlib/cmake_utils/test_for_libpng/CMakeLists.txt:8 (add_executable): Cannot generate a safe runtime search path for target libpng_test because files in some directories may conflict with libraries in implicit directories:

runtime library [libz.so.1] in /usr/lib64 may be hidden by files in:
  /home/ec2-user/anaconda3/lib

Some of these libraries may not be found correctly.

-- Found system copy of libpng: /home/ec2-user/anaconda3/lib/libpng.so;/usr/lib64/libz.so -- System copy of libpng is broken. Will build our own libpng and use that instead. -- Found system copy of libjpeg: /usr/lib64/libjpeg.so -- Found WebP: /home/ec2-user/anaconda3/lib/libwebp.so
-- System copy of libwebp is either too old or broken. Will disable WebP support. -- Searching for BLAS and LAPACK -- Searching for BLAS and LAPACK -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1") -- Checking for module 'cblas' -- No package 'cblas' found -- Checking for module 'lapack' -- No package 'lapack' found -- Looking for cblas_ddot -- Looking for cblasddot - not found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of void -- Check size of void - done -- Found Intel MKL BLAS/LAPACK library -- Looking for sgesv -- Looking for sgesv - found -- Looking for sgesv -- Looking for sgesv_ - found -- Found CUDA: /usr/local/cuda (found suitable version "11.0", minimum required is "7.5") -- Looking for cuDNN install... -- Found cuDNN: /usr/local/cuda/lib/libcudnn.so -- Building a CUDA test project to see if your compiler is compatible with CUDA... -- Building a cuDNN test project to check if you have the right version of cuDNN installed... -- Enabling CUDA support for dlib. DLIB WILL USE CUDA, compute capabilities: 50 -- Searching for FFMPEG/LIBAV -- Checking for modules 'libavdevice;libavfilter;libavformat;libavcodec;libswresample;libswscale;libavutil' -- No package 'libavdevice' found -- No package 'libavfilter' found -- No package 'libavformat' found -- No package 'libavcodec' found -- No package 'libswresample' found -- No package 'libswscale' found -- No package 'libavutil' found


No FFMPEG/LIBAV libraries found. On Ubuntu you can install them by executing sudo apt install libavdevice-dev libavfilter-dev libavformat-dev sudo apt install libavcodec-dev libswresample-dev libswscale-dev sudo apt install libavutil-dev


-- Configuring done -- Generating done -- Build files have been written to: /home/ec2-user/SageMaker/users/install dlib with cuda/dlib/build/temp.linux-x86_64-cpython-39 Invoking CMake build: 'cmake --build . --config Release -- -j4' [ 0%] Building NVCC (Device) object dlib_build/CMakeFiles/dlib.dir/cuda/dlib_generated_cusolver_dlibapi.cu.o [ 1%] Building NVCC (Device) object dlib_build/CMakeFiles/dlib.dir/cuda/dlib_generated_cuda_dlib.cu.o nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). [ 3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o [ 3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o [ 4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o [ 4%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o [ 5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_1.cpp.o [ 6%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_2.cpp.o [ 7%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_1.cpp.o [ 8%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_2.cpp.o [ 8%] Building CXX object dlib_build/CMakeFiles/dlib.dir/md5/md5_kernel_1.cpp.o [ 9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/tokenizer/tokenizer_kernel_1.cpp.o [ 10%] Building CXX object dlib_build/CMakeFiles/dlib.dir/unicode/unicode.cpp.o [ 11%] Building CXX object dlib_build/CMakeFiles/dlib.dir/test_for_odr_violations.cpp.o [ 12%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_1.cpp.o [ 12%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bsp/bsp.cpp.o [ 13%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_1.cpp.o [ 14%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_2.cpp.o [ 15%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_extensions.cpp.o [ 16%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o [ 16%] Building CXX object dlib_build/CMakeFiles/dlib.dir/linker/linker_kernel_1.cpp.o [ 17%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/extra_logger_headers.cpp.o [ 18%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/logger_kernel_1.cpp.o [ 19%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/logger_config_file.cpp.o [ 19%] Building CXX object dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_1.cpp.o [ 20%] Building CXX object dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_2.cpp.o [ 21%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_extensions.cpp.o [ 22%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_2.cpp.o [ 23%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf.cpp.o [ 23%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf_unbuffered.cpp.o [ 24%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_kernel.cpp.o [ 25%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_iostream.cpp.o [ 26%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_http.cpp.o [ 27%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/multithreaded_object_extension.cpp.o [ 27%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threaded_object_extension.cpp.o [ 28%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_1.cpp.o [ 29%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_2.cpp.o [ 30%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_shared.cpp.o [ 30%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/thread_pool_extension.cpp.o [ 31%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/async.cpp.o [ 32%] Building CXX object dlib_build/CMakeFiles/dlib.dir/timer/timer.cpp.o [ 33%] Building CXX object dlib_build/CMakeFiles/dlib.dir/stack_trace.cpp.o [ 34%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/cpu_dlib.cpp.o [ 34%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/tensor_tools.cpp.o [ 35%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o [ 36%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/mnist.cpp.o [ 37%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/cifar.cpp.o [ 38%] Building CXX object dlib_build/CMakeFiles/dlib.dir/global_optimization/global_function_search.cpp.o [ 38%] Building CXX object dlib_build/CMakeFiles/dlib.dir/filtering/kalman_filter.cpp.o [ 39%] Building CXX object dlib_build/CMakeFiles/dlib.dir/svm/auto.cpp.o [ 40%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/widgets.cpp.o [ 41%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/drawable.cpp.o [ 41%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/canvas_drawing.cpp.o [ 42%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/style.cpp.o [ 43%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/base_widgets.cpp.o [ 44%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_core/gui_core_kernel_1.cpp.o [ 45%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_core/gui_core_kernel_2.cpp.o [ 45%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/arm/arm_init.c.o [ 46%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/arm/filter_neon_intrinsics.c.o [ 47%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/arm/palette_neon_intrinsics.c.o [ 48%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/png.c.o [ 49%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngerror.c.o [ 49%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngget.c.o [ 50%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngmem.c.o [ 51%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngpread.c.o [ 52%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngread.c.o [ 53%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngrio.c.o [ 53%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngrtran.c.o [ 54%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngrutil.c.o [ 55%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngset.c.o [ 56%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngtrans.c.o [ 56%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngwio.c.o [ 57%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngwrite.c.o [ 58%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngwtran.c.o [ 59%] Building C object dlib_build/CMakeFiles/dlib.dir/external/libpng/pngwutil.c.o [ 60%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/adler32.c.o [ 60%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/compress.c.o [ 61%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/crc32.c.o [ 62%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/deflate.c.o [ 63%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/gzclose.c.o [ 64%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/gzlib.c.o [ 64%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/gzread.c.o [ 65%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/gzwrite.c.o [ 66%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/infback.c.o [ 67%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/inffast.c.o [ 67%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/inflate.c.o [ 68%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/inftrees.c.o [ 69%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/trees.c.o [ 70%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/uncompr.c.o [ 71%] Building C object dlib_build/CMakeFiles/dlib.dir/external/zlib/zutil.c.o [ 71%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_loader/png_loader.cpp.o [ 72%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_saver/save_png.cpp.o [ 73%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_loader/jpeg_loader.cpp.o [ 74%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_saver/save_jpeg.cpp.o [ 75%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/cudnn_dlibapi.cpp.o [ 75%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/cublas_dlibapi.cpp.o [ 76%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/curand_dlibapi.cpp.o [ 77%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/cuda_data_ptr.cpp.o [ 78%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/gpu_data.cpp.o [ 79%] Linking CXX static library libdlib.a [ 79%] Built target dlib [ 79%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/dlib.cpp.o [ 80%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/vector.cpp.o [ 81%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/svm_c_trainer.cpp.o [ 82%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/matrix.cpp.o [ 82%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/svm_rank_trainer.cpp.o [ 83%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/decision_functions.cpp.o [ 84%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/other.cpp.o [ 85%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/basic.cpp.o [ 86%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/cca.cpp.o [ 86%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/sequence_segmenter.cpp.o [ 87%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/svm_struct.cpp.o [ 88%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image.cpp.o [ 89%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image2.cpp.o [ 90%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image3.cpp.o [ 90%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image4.cpp.o [ 91%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/rectangles.cpp.o [ 92%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/object_detection.cpp.o [ 93%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/shape_predictor.cpp.o [ 93%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/correlation_tracker.cpp.o [ 94%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/face_recognition.cpp.o [ 95%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/cnn_face_detector.cpp.o [ 96%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/global_optimization.cpp.o [ 97%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image_dataset_metadata.cpp.o [ 97%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/numpy_returns.cpp.o [ 98%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/line.cpp.o [ 99%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/gui.cpp.o [100%] Linking CXX shared module "/home/ec2-user/SageMaker/users/install dlib with cuda/dlib/build/lib.linux-x86_64-cpython-39/_dlib_pybind11.cpython-39-x86_64-linux-gnu.so" [100%] Built target _dlib_pybind11 creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/dlib copying build/lib.linux-x86_64-cpython-39/dlib/init.py -> build/bdist.linux-x86_64/egg/dlib copying build/lib.linux-x86_64-cpython-39/_dlib_pybind11.cpython-39-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg byte-compiling build/bdist.linux-x86_64/egg/dlib/init.py to init.cpython-39.pyc creating stub loader for _dlib_pybind11.cpython-39-x86_64-linux-gnu.so byte-compiling build/bdist.linux-x86_64/egg/_dlib_pybind11.py to _dlib_pybind11.cpython-39.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying tools/python/dlib.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying tools/python/dlib.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying tools/python/dlib.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying tools/python/dlib.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO copying tools/python/dlib.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt creating dist creating 'dist/dlib-19.24.99-py3.9-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing dlib-19.24.99-py3.9-linux-x86_64.egg creating /home/ec2-user/anaconda3/envs/art_intel/lib/python3.9/site-packages/dlib-19.24.99-py3.9-linux-x86_64.egg Extracting dlib-19.24.99-py3.9-linux-x86_64.egg to /home/ec2-user/anaconda3/envs/art_intel/lib/python3.9/site-packages Adding dlib 19.24.99 to easy-install.pth file

Installed /home/ec2-user/anaconda3/envs/art_intel/lib/python3.9/site-packages/dlib-19.24.99-py3.9-linux-x86_64.egg Processing dependencies for dlib==19.24.99 Finished processing dependencies for dlib==19.24.99

However, when I tried dlib/python_examples/cnn_face_detector.py, I got some errors.

Expected Behavior

I should be able to get the face to be recognized.

Current Behavior

When I run this python file, I got this:

Processing file: ../examples/faces/2007_007763.jpg Could not load library libcudnn_cnn_train.so.8. Error: /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8: symbol _Z22cudnnGenericOpTensorNdILi3EE13cudnnStatus_tP12cudnnContext16cudnnGenericOp_t21cudnnNanPropagation_tPKdPKvPK17cudnnTensorStructS8_S8_SB_S8_S8_SB_Pv, version libcudnn_ops_infer.so.8 not defined in file libcudnn_ops_infer.so.8 with link time reference

Steps to Reproduce

Now I am using Amazon-sagemaker with a ml.g4dn.xlarge jupyter notebook. I use the following script when I start this notebook:

!/bin/bash

set -e

use ec2-user for operations

sudo -u ec2-user -i <<'EOF'

environment creation

conda create -n art_intel python=3.9 -y source activate conda activate art_intel

make new environment accessible

conda install ipykernel -y python -m ipykernel install --user --name art_intel --display-name art_intel

changing pip and python location, making sure that pip command can be executed correctly.

cd ~/anaconda3/envs/JupyterSystemEnv/bin/ sudo ln -sf /home/ec2-user/anaconda3/envs/art_intel/bin/pip pip

installing packages

conda install dlib==19.24.0 -y pip install opencv-python==4.7.0.68 pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

the following two lines are necessary for the python command to be executed correctly.

cd ~/anaconda3/envs/JupyterSystemEnv/bin/ sudo ln -sf /home/ec2-user/anaconda3/envs/art_intel/bin/python3.9 python

EOF

I noted that the suitable cuda version is 11.0, however when I use nvidia-smi, I found that the cuda version is 11.6. Can this cause this problem? How should I fix it? Thank you guys.

1LOVESJohnny commented 1 year ago

same error here

1LOVESJohnny commented 1 year ago

Just solved it. My solution for a reference:

  1. add up the library path to the LD_LIBRARY_PATH
  2. if pump up another error saying "libcudnn_ops_infer.so.8 not defined in file libcudnn_ops_infer.so.8 with link time reference", set "export LD_PRELOAD=path-to-the-library.so"

Anyways, this solution seems a short-term walkaround. Still hope to see a long-term solution...

dentistfrankchen commented 1 year ago

@1LOVESJohnny Did you solve it by adding os.enviro['LD-PRELOAD'] to the py file? I tried this way, but it did not work. Can you show me your solution code?

dentistfrankchen commented 1 year ago

I tried several ways, but none of those worked. Here are my tests in the command line: test.txt

1LOVESJohnny commented 1 year ago

@1LOVESJohnny Did you solve it by adding os.enviro['LD-PRELOAD'] to the py file? I tried this way, but it did not work. Can you show me your solution code?

Hi I took a glimpse of your .txt file. Here are my detailed solution, note that I just input all the commands in the bash within a conda env:

  1. First, add up the LD_LIBRARY_PATH with your installed CUDA+cudnn directory. export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib/:$LD_LIBRARY_PATH

  2. Then, set up the LD_PRELOAD variable to the library directory with the command as below: (in your case) export LD_PRELOAD=/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8

Anyways, as stated before, it is just a walkaround and suggest you to conduct all these commands under a conda env so as to protect your global environment neat.

Another point you should pay attention to is the version of cudnn and CUDA must match up. And be sure your cudnn has been well installed.

Hope it can help!

dentistfrankchen commented 1 year ago

@1LOVESJohnny Thank you a lot. My problem got solved by trying the first step of your solution. You saved my day. I really appreciate for your help.

dlib-issue-bot commented 1 year ago

Warning: this issue has been inactive for 35 days and will be automatically closed on 2023-03-24 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot commented 1 year ago

Warning: this issue has been inactive for 43 days and will be automatically closed on 2023-03-24 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot commented 1 year ago

Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.