Description
Hi,
Linux Ubuntu 16.04 + ROS Kinetic
I am attempting to install this facial recognition tool on my Nvidia Jetson TX2. When typing cmake --build dlib, it gives this error:
-- Using CMake version: 3.5.1
-- Compiling dlib version: 19.19.99
-- Found system copy of libpng: /usr/lib/aarch64-linux-gnu/libpng.so;/usr/lib/aarch64-linux-gnu/libz.so
-- Found system copy of libjpeg: /usr/lib/aarch64-linux-gnu/libjpeg.so
-- Searching for BLAS and LAPACK
-- Searching for BLAS and LAPACK
-- Checking for module 'cblas'
-- No package 'cblas' found
-- Found LAPACK library
-- Found BLAS library
-- Looking for cuDNN install...
-- Found cuDNN: /usr/lib/aarch64-linux-gnu/libcudnn.so
-- Enabling CUDA support for dlib. DLIB WILL USE CUDA
-- C++11 activated.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nvidia/dlib/build
[ 1%] Building NVCC (Device) object dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cuda_dlib.cu.o
/home/nvidia/dlib/dlib/cuda/cuda_dlib.cu(1691): error: calling a constexpr host function("log1p") from a device function("cuda_log1pexp") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
1 error detected in the compilation of "/tmp/tmpxft_0000413e_00000000-6_cuda_dlib.cpp1.ii".
CMake Error at dlib_generated_cuda_dlib.cu.o.cmake:266 (message):
Error generating file
/home/nvidia/dlib/build/dlib/CMakeFiles/dlib.dir/cuda/./dlib_generated_cuda_dlib.cu.o
dlib/CMakeFiles/dlib.dir/build.make:570: recipe for target 'dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cuda_dlib.cu.o' failed
make[2]: *** [dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cuda_dlib.cu.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'dlib/CMakeFiles/dlib.dir/all' failed
make[1]: *** [dlib/CMakeFiles/dlib.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
Activity
alessiosavi commentedon Feb 2, 2020
Create a folder for host the source
Clone the repository
Create a folder for build the software (cmake have to be installed)
Now run cmake with the following options:
If everything is fine, you can see a similar output
NOTE: Install cuDNN, openblas and Intel MKL/BLAS/LAPACK if your system is compliant with them.
Link to Intel Performance Library: https://software.seek.intel.com/performance-libraries
Link to cuDNN: https://developer.nvidia.com/cudnn
Now you can compile the source with
After these step, the source is compiled.
Now you can install the python API.
NOTE: The compilation this time will use all the available CPU, be sure that you have enough memory for compile.
Once completed, you can query your python packages for be sure that dlib is now installed:
pip freeze | grep dlib
For check if the installation was succesfully:
Open a terminal and run the following
Source: https://stackoverflow.com/a/57592670/9361998
Azza71 commentedon Feb 4, 2020
@alessiosavi
After compiling with cmake --build . --config Release, I get this error (it's the same as before):
Building NVCC (Device) object dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cusolver_dlibapi.cu.o
nvcc fatal : Could not open output file /opt/SP/packages/dlib/build/dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cusolver_dlibapi.cu.o.NVCC-depend
CMake Error at dlib_generated_cusolver_dlibapi.cu.o.cmake:207 (message):
Error generating
/opt/SP/packages/dlib/build/dlib/CMakeFiles/dlib.dir/cuda/./dlib_generated_cusolver_dlibapi.cu.o
dlib/CMakeFiles/dlib.dir/build.make:70: recipe for target 'dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cusolver_dlibapi.cu.o' failed
make[2]: *** [dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cusolver_dlibapi.cu.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'dlib/CMakeFiles/dlib.dir/all' failed
make[1]: *** [dlib/CMakeFiles/dlib.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
alessiosavi commentedon Feb 4, 2020
Have you run it as
sudo
?alexander-chan commentedon Feb 21, 2020
@alessiosavi I experiencing the same issue as Azza71.
Using Ubuntu 18.04.4 bionic. CUDA 10.2. NVIDIA-SMI 440.33.01
I tried running
cmake --build . --config Release
and got this
I tried running
sudo cmake --build . --config Release
, but it says cmake not found when sudo is used as well. cmake is installed on my computer.ATeryohin commentedon Feb 25, 2020
try this command for cmake: cmake .. -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1 -DCUDA_NVCC_FLAGS="--expt-relaxed-constexpr"
rupesharora commentedon Mar 28, 2020
Instead of cmake yourself, you can use this command in your root directory of dlib
python3 setup.py install --set DLIB_USE_CUDA=1 --set USE_AVX_INSTRUCTIONS=1 --set CUDA_NVCC_FLAGS="--expt-relaxed-constexpr"
This will automatically create the build folder.
Note: Whatever arguments you want to pass in cmake, you can directly pass in setup.py file as well
For example
cmake .. -DDLIB_USE_CUDA=1
similar way in setup.py will bepython3 setup.py install --set DLIB_USE_CUDA=1
Azza71 commentedon Apr 17, 2020
Thank you all for the help. The issue was fixed when I looked at this, the issue exists for both jetson nano and jetson TX2: https://medium.com/@ageitgey/build-a-hardware-based-face-recognition-system-for-150-with-the-nvidia-jetson-nano-and-python-a25cb8c891fd