Here are the instructions I followed initially to install DLib without CUDA support:
$ sudo apt update
$ sudo apt upgrade
$ wget http://dlib.net/files/dlib-19.17.tar.bz2
$ tar jxvf dlib-19.17.tar.bz2
$ tar jxvf dlib-19.17.tar.bz2
$ cd dlib-19.17/
$ gedit dlib/cuda/cudnn_dlibapi.cpp
In the above file, you have to search for forward_algo... = forawrd_....
Comment out this line.
after that go back to the main dlib-19.17 folder
$ sudo python3 setup.py install
Finally,
$ sudo pip3 install face_recognition
I wish to re-install DLib with CUDA support, so would running the commands below, setup CUDA support for DLib?
$ sudo apt update
$ sudo apt upgrade
$ wget http://dlib.net/files/dlib-19.17.tar.bz2
$ tar jxvf dlib-19.17.tar.bz2
$ tar jxvf dlib-19.17.tar.bz2
$ cd dlib-19.17/
$ gedit dlib/cuda/cudnn_dlibapi.cpp
In the above file, you have to search for forward_algo... = forawrd_....
Comment out this line.
after that go back to the main dlib-19.17 folder
$ sudo python3 setup.py install --set DLIB_USE_CUDA=1
Finally,
$ sudo pip3 install face_recognition
Does using the --set DLIB_USE_CUDA=1 flag all that’s required to set up CUDA support?
Or do I have to use the $ sudo python3 setup.py install -- -D DLIB_USE_CUDA=1 command instead of the $ sudo python3 setup.py install --set DLIB_USE_CUDA=1 command for CUDA support on the Nano?
@AastaLLL Now that I have DLib installed with CUDA support, does just having the line import face_recognition run the facial recognition code on the GPU? Or do I need any additional configurations to be done for the facial recognition code using DLib to run on the GPU?
Hey @AastaLLL after installing DLib 19.21 on my nano with CUDA support the the facial recognition program that used to run at about 5fps, not does not even run, after running the code on the terminal, I don’t see the live feed from the webcams. What could be the reason for this?