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.53k stars 3.37k forks source link

dlib.DLIB_USE_CUDA=True and dlib.cuda.get_num_devices() = 6,but cannot see any process in nvidia-smi. #2302

Closed Dajiang1202 closed 3 years ago

Dajiang1202 commented 3 years ago

Expected Behavior

my code does not use CUDA. related code:

import dlib

print(dlib.DLIB_USE_CUDA)

print(dlib.cuda.get_num_devices())

detector = dlib.get_frontal_face_detector()

predictor = dlib.shape_predictor("shape_predictor.dat")

rects = detector(gray, 0)

for rect in rects:

    shape = predictor(gray, rect)

Current Behavior

dlib.DLIB_USE_CUDA=True and dlib.cuda.get_num_devices() = 6 but there is no process in nvidia-smi and the cpu usage is pretty high. Ubuntu 16.04 Driver Version: 440.95.01
CUDA Version: 10.2

I downloaded zip form this repo and the following are the steps to setup dlib. mkdir build cd build cmake .. -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1 cmake --build . cd .. python setup.py install --set USE_AVX_INSTRUCTIONS=1 --set DLIB_USE_CUDA=1

(yhngpu) jiangyunjia@node2:~/dlibgou/dlib/build$ cmake .. -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1 -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using CMake version: 3.5.1 -- Compiling dlib version: 19.21.99 -- Enabling AVX instructions -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- 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
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so -- 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 -- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so -- Found system copy of libpng: /home/jiangyunjia/anaconda3/lib/libpng.so;/home/jiangyunjia/anaconda3/en -- Found system copy of libjpeg: /home/jiangyunjia/anaconda3/lib/libjpeg.so -- Searching for BLAS and LAPACK -- Searching for BLAS and LAPACK -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.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-10.2 (found suitable version "10.2", minimum required is "7.5") -- Looking for cuDNN install... -- Found cuDNN: /usr/local/cuda-10.2/lib64/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 -- C++11 activated. -- Configuring done -- Generating done -- Build files have been written to: /home/jiangyunjia/dlibgou/dlib/build

(yhngpu) jiangyunjia@node2:~/dlibgou/dlib/build$ cmake --build . [ 1%] Building NVCC (Device) object dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cusolver_dlibapi.cu.o [ 2%] Building NVCC (Device) object dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cuda_dlib.cu.o Scanning dependencies of target dlib [ 4%] Building CXX object dlib/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o [ 5%] Building CXX object dlib/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o [ 7%] Building CXX object dlib/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o [ 8%] Building CXX object dlib/CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o [ 10%] Building CXX object dlib/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_1.cpp.o [ 11%] Building CXX object dlib/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_2.cpp.o [ 13%] Building CXX object dlib/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_1.cpp.o [ 14%] Building CXX object dlib/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_2.cpp.o [ 16%] Building CXX object dlib/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o [ 17%] Building CXX object dlib/CMakeFiles/dlib.dir/md5/md5_kernel_1.cpp.o [ 19%] Building CXX object dlib/CMakeFiles/dlib.dir/tokenizer/tokenizer_kernel_1.cpp.o [ 20%] Building CXX object dlib/CMakeFiles/dlib.dir/unicode/unicode.cpp.o [ 22%] Building CXX object dlib/CMakeFiles/dlib.dir/test_for_odr_violations.cpp.o [ 23%] Building CXX object dlib/CMakeFiles/dlib.dir/sockets/sockets_kernel_1.cpp.o [ 25%] Building CXX object dlib/CMakeFiles/dlib.dir/bsp/bsp.cpp.o [ 26%] Building CXX object dlib/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_1.cpp.o [ 28%] Building CXX object dlib/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_2.cpp.o [ 29%] Building CXX object dlib/CMakeFiles/dlib.dir/dir_nav/dir_nav_extensions.cpp.o [ 31%] Building CXX object dlib/CMakeFiles/dlib.dir/linker/linker_kernel_1.cpp.o [ 32%] Building CXX object dlib/CMakeFiles/dlib.dir/logger/extra_logger_headers.cpp.o [ 34%] Building CXX object dlib/CMakeFiles/dlib.dir/logger/logger_kernel_1.cpp.o [ 35%] Building CXX object dlib/CMakeFiles/dlib.dir/logger/logger_config_file.cpp.o [ 37%] Building CXX object dlib/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_1.cpp.o [ 38%] Building CXX object dlib/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_2.cpp.o [ 40%] Building CXX object dlib/CMakeFiles/dlib.dir/sockets/sockets_extensions.cpp.o [ 41%] Building CXX object dlib/CMakeFiles/dlib.dir/sockets/sockets_kernel_2.cpp.o [ 43%] Building CXX object dlib/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf.cpp.o [ 44%] Building CXX object dlib/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf_unbuffered.cpp.o [ 46%] Building CXX object dlib/CMakeFiles/dlib.dir/server/server_kernel.cpp.o [ 47%] Building CXX object dlib/CMakeFiles/dlib.dir/server/server_iostream.cpp.o [ 49%] Building CXX object dlib/CMakeFiles/dlib.dir/server/server_http.cpp.o [ 50%] Building CXX object dlib/CMakeFiles/dlib.dir/threads/multithreaded_object_extension.cpp.o [ 52%] Building CXX object dlib/CMakeFiles/dlib.dir/threads/threaded_object_extension.cpp.o [ 53%] Building CXX object dlib/CMakeFiles/dlib.dir/threads/threads_kernel_1.cpp.o [ 55%] Building CXX object dlib/CMakeFiles/dlib.dir/threads/threads_kernel_2.cpp.o [ 56%] Building CXX object dlib/CMakeFiles/dlib.dir/threads/threads_kernel_shared.cpp.o [ 58%] Building CXX object dlib/CMakeFiles/dlib.dir/threads/thread_pool_extension.cpp.o [ 59%] Building CXX object dlib/CMakeFiles/dlib.dir/threads/async.cpp.o [ 61%] Building CXX object dlib/CMakeFiles/dlib.dir/timer/timer.cpp.o [ 62%] Building CXX object dlib/CMakeFiles/dlib.dir/stack_trace.cpp.o [ 64%] Building CXX object dlib/CMakeFiles/dlib.dir/cuda/cpu_dlib.cpp.o [ 65%] Building CXX object dlib/CMakeFiles/dlib.dir/cuda/tensor_tools.cpp.o [ 67%] Building CXX object dlib/CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o [ 68%] Building CXX object dlib/CMakeFiles/dlib.dir/data_io/mnist.cpp.o [ 70%] Building CXX object dlib/CMakeFiles/dlib.dir/data_io/cifar.cpp.o [ 71%] Building CXX object dlib/CMakeFiles/dlib.dir/global_optimization/global_function_search.cpp.o [ 73%] Building CXX object dlib/CMakeFiles/dlib.dir/filtering/kalman_filter.cpp.o [ 74%] Building CXX object dlib/CMakeFiles/dlib.dir/svm/auto.cpp.o [ 76%] Building CXX object dlib/CMakeFiles/dlib.dir/gui_widgets/widgets.cpp.o [ 77%] Building CXX object dlib/CMakeFiles/dlib.dir/gui_widgets/drawable.cpp.o [ 79%] Building CXX object dlib/CMakeFiles/dlib.dir/gui_widgets/canvas_drawing.cpp.o [ 80%] Building CXX object dlib/CMakeFiles/dlib.dir/gui_widgets/style.cpp.o [ 82%] Building CXX object dlib/CMakeFiles/dlib.dir/gui_widgets/base_widgets.cpp.o [ 83%] Building CXX object dlib/CMakeFiles/dlib.dir/gui_core/gui_core_kernel_1.cpp.o [ 85%] Building CXX object dlib/CMakeFiles/dlib.dir/gui_core/gui_core_kernel_2.cpp.o [ 86%] Building CXX object dlib/CMakeFiles/dlib.dir/image_loader/png_loader.cpp.o [ 88%] Building CXX object dlib/CMakeFiles/dlib.dir/image_saver/save_png.cpp.o [ 89%] Building CXX object dlib/CMakeFiles/dlib.dir/image_loader/jpeg_loader.cpp.o [ 91%] Building CXX object dlib/CMakeFiles/dlib.dir/image_saver/save_jpeg.cpp.o [ 92%] Building CXX object dlib/CMakeFiles/dlib.dir/cuda/cudnn_dlibapi.cpp.o [ 94%] Building CXX object dlib/CMakeFiles/dlib.dir/cuda/cublas_dlibapi.cpp.o [ 95%] Building CXX object dlib/CMakeFiles/dlib.dir/cuda/curand_dlibapi.cpp.o [ 97%] Building CXX object dlib/CMakeFiles/dlib.dir/cuda/cuda_data_ptr.cpp.o [ 98%] Building CXX object dlib/CMakeFiles/dlib.dir/cuda/gpu_data.cpp.o [100%] Linking CXX static library libdlib.a [100%] Built target dlib

(yhngpu) jiangyunjia@node2:~/dlibgou/dlib$ python setup.py install --set USE_AVX_INSTRUCTIONS=1 --set DL running install 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' package init file 'tools/python/dlib/init.py' not found (or not a regular file) reading manifest file 'tools/python/dlib.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'tools/python/build' 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.7.9 (default, Aug 31 2020, 12:42:55) Invoking CMake setup: 'cmake /home/jiangyunjia/dlibgou/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORdlib/build/lib.linux-x86_64-3.7 -DPYTHON_EXECUTABLE=/home/jiangyunjia/anaconda3/envs/yhngpu/bin/python -IB_USE_CUDA=1 -DCMAKE_BUILD_TYPE=Release' -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: /home/jiangyunjia/anaconda3/envs/yhngpu/bin/python (found version "3.7.9") -- Found PythonLibs: /home/jiangyunjia/anaconda3/envs/yhngpu/lib/libpython3.7m.so -- Performing Test HAS_CPP14_FLAG -- Performing Test HAS_CPP14_FLAG - Success -- pybind11 v2.2.4 -- Using CMake version: 3.5.1 -- Compiling dlib version: 19.21.99 -- SSE4 instructions can be executed by the host processor. -- AVX instructions can be executed by the host processor. -- Enabling AVX instructions -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- 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
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so -- 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 -- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so -- Found system copy of libpng: /home/jiangyunjia/anaconda3/lib/libpng.so;/home/jiangyunjia/anaconda3/en -- Found system copy of libjpeg: /home/jiangyunjia/anaconda3/lib/libjpeg.so -- Searching for BLAS and LAPACK -- Searching for BLAS and LAPACK -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Checking for module 'cblas' -- No package 'cblas' found -- Checking for module 'lapack' -- No package 'lapack' found -- Looking for cblas_ddot -- Looking for cblas_ddot - 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-10.2 (found suitable version "10.2", minimum required is "7.5") -- Looking for cuDNN install... -- Found cuDNN: /usr/local/cuda-10.2/lib64/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 -- C++11 activated. -- Configuring done -- Generating done -- Build files have been written to: /home/jiangyunjia/dlibgou/dlib/build/temp.linux-x86_64-3.7 Invoking CMake build: 'cmake --build . --config Release -- -j72' [ 2%] Building NVCC (Device) object dlib_build/CMakeFiles/dlib.dir/cuda/dlib_generated_cusolver_dlibapi [ 2%] Building NVCC (Device) object dlib_build/CMakeFiles/dlib.dir/cuda/dlib_generated_cuda_dlib.cu.o Scanning dependencies of target dlib [ 3%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o [ 5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o [ 5%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_2.cpp.o [ 6%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bit_stream/bit_stream_kernel_1.cpp.o [ 7%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_2.cpp.o [ 9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_decoder/entropy_decoder_kernel_1.cpp.o [ 9%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_2.cpp.o [ 10%] Building CXX object dlib_build/CMakeFiles/dlib.dir/entropy_encoder/entropy_encoder_kernel_1.cpp.o [ 11%] Building CXX object dlib_build/CMakeFiles/dlib.dir/tokenizer/tokenizer_kernel_1.cpp.o [ 12%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_1.cpp.o [ 14%] Building CXX object dlib_build/CMakeFiles/dlib.dir/test_for_odr_violations.cpp.o [ 14%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o [ 15%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_extensions.cpp.o [ 17%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/logger_kernel_1.cpp.o [ 19%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/extra_logger_headers.cpp.o [ 19%] Building CXX object dlib_build/CMakeFiles/dlib.dir/unicode/unicode.cpp.o [ 21%] Building CXX object dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_1.cpp.o [ 21%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_extensions.cpp.o [ 23%] Building CXX object dlib_build/CMakeFiles/dlib.dir/md5/md5_kernel_1.cpp.o [ 24%] Building CXX object dlib_build/CMakeFiles/dlib.dir/linker/linker_kernel_1.cpp.o [ 24%] Building CXX object dlib_build/CMakeFiles/dlib.dir/logger/logger_config_file.cpp.o [ 26%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bsp/bsp.cpp.o [ 26%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_1.cpp.o [ 27%] Building CXX object dlib_build/CMakeFiles/dlib.dir/dir_nav/dir_nav_kernel_2.cpp.o [ 28%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_1.cpp.o [ 30%] Building CXX object dlib_build/CMakeFiles/dlib.dir/misc_api/misc_api_kernel_2.cpp.o [ 30%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf.cpp.o [ 31%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockets/sockets_kernel_2.cpp.o [ 32%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_2.cpp.o [ 34%] Building CXX object dlib_build/CMakeFiles/dlib.dir/sockstreambuf/sockstreambuf_unbuffered.cpp.o [ 35%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_kernel.cpp.o [ 36%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_iostream.cpp.o [ 37%] Building CXX object dlib_build/CMakeFiles/dlib.dir/timer/timer.cpp.o [ 38%] Building CXX object dlib_build/CMakeFiles/dlib.dir/server/server_http.cpp.o [ 40%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/multithreaded_object_extension.cpp.o [ 40%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threads_kernel_shared.cpp.o [ 41%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/threaded_object_extension.cpp.o [ 42%] Building CXX object dlib_build/CMakeFiles/dlib.dir/stack_trace.cpp.o [ 43%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/thread_pool_extension.cpp.o [ 44%] Building CXX object dlib_build/CMakeFiles/dlib.dir/threads/async.cpp.o [ 45%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/cpu_dlib.cpp.o [ 46%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/tensor_tools.cpp.o [ 47%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/image_dataset_metadata.cpp.o [ 48%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/cifar.cpp.o [ 51%] Building CXX object dlib_build/CMakeFiles/dlib.dir/filtering/kalman_filter.cpp.o [ 51%] Building CXX object dlib_build/CMakeFiles/dlib.dir/global_optimization/global_function_search.cpp [ 52%] Building CXX object dlib_build/CMakeFiles/dlib.dir/data_io/mnist.cpp.o [ 53%] Building CXX object dlib_build/CMakeFiles/dlib.dir/svm/auto.cpp.o [ 55%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/style.cpp.o [ 55%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/widgets.cpp.o [ 56%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/canvas_drawing.cpp.o [ 57%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/drawable.cpp.o [ 58%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_core/gui_core_kernel_2.cpp.o [ 59%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_core/gui_core_kernel_1.cpp.o [ 60%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/base_widgets.cpp.o [ 61%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_loader/png_loader.cpp.o [ 63%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_saver/save_png.cpp.o [ 63%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_saver/save_jpeg.cpp.o [ 64%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/cudnn_dlibapi.cpp.o [ 65%] Building CXX object dlib_build/CMakeFiles/dlib.dir/image_loader/jpeg_loader.cpp.o [ 67%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/curand_dlibapi.cpp.o [ 68%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/cuda_data_ptr.cpp.o [ 69%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/cublas_dlibapi.cpp.o [ 70%] Building CXX object dlib_build/CMakeFiles/dlib.dir/cuda/gpu_data.cpp.o [ 71%] Linking CXX static library libdlib.a [ 71%] Built target dlib Scanning dependencies of target _dlib_pybind11 [ 72%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/dlib.cpp.o [ 73%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/matrix.cpp.o [ 74%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/vector.cpp.o [ 75%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/svm_c_trainer.cpp.o [ 76%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/svm_rank_trainer.cpp.o [ 77%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/decision_functions.cpp.o [ 78%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/basic.cpp.o [ 79%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/other.cpp.o [ 80%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/cca.cpp.o [ 81%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/sequence_segmenter.cpp.o [ 82%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/svm_struct.cpp.o [ 84%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/rectangles.cpp.o [ 85%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image.cpp.o [ 86%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/shape_predictor.cpp.o [ 87%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image4.cpp.o [ 88%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/correlation_tracker.cpp.o [ 89%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image3.cpp.o [ 90%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image2.cpp.o [ 91%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/object_detection.cpp.o [ 92%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/face_recognition.cpp.o [ 93%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/cnn_face_detector.cpp.o [ 94%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/global_optimization.cpp.o [ 95%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image_dataset_metadata.cpp.o [ 96%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/gui.cpp.o [ 97%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/line.cpp.o [ 98%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/numpy_returns.cpp.o [100%] Linking CXX shared module /home/jiangyunjia/dlibgou/dlib/build/lib.linux-x86_64-3.7/_dlib_pybind1nu.so [100%] Built target _dlib_pybind11 creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg copying build/lib.linux-x86_64-3.7/_dlib_pybind11.cpython-37m-x86_64-linux-gnu.so -> build/bdist.linux-x creating build/bdist.linux-x86_64/egg/dlib copying build/lib.linux-x86_64-3.7/dlib/init.py -> build/bdist.linux-x86_64/egg/dlib byte-compiling build/bdist.linux-x86_64/egg/dlib/init.py to init.cpython-37.pyc creating stub loader for _dlib_pybind11.cpython-37m-x86_64-linux-gnu.so byte-compiling build/bdist.linux-x86_64/egg/_dlib_pybind11.py to _dlib_pybind11.cpython-37.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.21.99-py3.7-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.21.99-py3.7-linux-x86_64.egg creating /home/jiangyunjia/anaconda3/envs/yhngpu/lib/python3.7/site-packages/dlib-19.21.99-py3.7-linux-x Extracting dlib-19.21.99-py3.7-linux-x86_64.egg to /home/jiangyunjia/anaconda3/envs/yhngpu/lib/python3.7 Adding dlib 19.21.99 to easy-install.pth file

Installed /home/jiangyunjia/anaconda3/envs/yhngpu/lib/python3.7/site-packages/dlib-19.21.99-py3.7-linux- Processing dependencies for dlib==19.21.99 Finished processing dependencies for dlib==19.21.99

davisking commented 3 years ago

You have multiple versions of dlib installed and are not using the one you just installed.

Dajiang1202 commented 3 years ago

You have multiple versions of dlib installed and are not using the one you just installed.

Thanks for your reply, the following content is my conda list, there is only one dlib installed.

_libgcc_mutex 0.1 main https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ca-certificates 2021.1.19 h06a4308_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main certifi 2020.12.5 py37h06a4308_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main dlib 19.21.99 pypi_0 pypi imutils 0.5.4 pypi_0 pypi ld_impl_linux-64 2.33.1 h53a641e_7 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libedit 3.1.20191231 h14c3975_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libffi 3.3 he6710b0_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libgcc-ng 9.1.0 hdf63c60_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libstdcxx-ng 9.1.0 hdf63c60_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ncurses 6.2 he6710b0_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main numpy 1.20.1 pypi_0 pypi opencv-python 4.5.1.48 pypi_0 pypi openssl 1.1.1i h27cfd23_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main pip 20.3.3 py37h06a4308_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main python 3.7.9 h7579374_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main readline 8.1 h27cfd23_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main scipy 1.6.0 pypi_0 pypi setuptools 52.0.0 py37h06a4308_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main sqlite 3.33.0 h62c20be_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main tk 8.6.10 hbc83047_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main wheel 0.36.2 pyhd3eb1b0_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main xlrd 2.0.1 pypi_0 pypi xlutils 2.0.0 pypi_0 pypi xlwt 1.3.0 pypi_0 pypi xz 5.2.5 h7b6447c_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main zlib 1.2.11 h7b6447c_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

arrufat commented 3 years ago

Not with dlib, but I've had some problems with other python packages I've built, and I realized I had to uninstall them several times. Even though you might only see one, once you uninstall it, you might see another version... Try uninstalling them all and the install the version you want to use :)

Dajiang1202 commented 3 years ago

Not with dlib, but I've had some problems with other python packages I've built, and I realized I had to uninstall them several times. Even though you might only see one, once you uninstall it, you might see another version... Try uninstalling them all and the install the version you want to use :)

Thanks for your reply. Still don't work. Can dlib.get_frontal_face_detector and dlib.shape_predictor really be accelerated by GPU?

arrufat commented 3 years ago

Those models don't make use of the GPU. You should go with the deep-learning based face detector to use the GPU. Check this example.

davisking commented 3 years ago

Yeah, sorry, what @arrufat said is right. I replied to this from my phone without reading the whole post :| It looks like everything is working as expected.

annoyingCode commented 4 months ago

I have correctly installed CUDA and cuDNN but still dlib is not using CUDA. Kindly help me out here @davisking