ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
53.59k stars 13.51k forks source link

Jetson Nano is not using the GPU #1375

Open T1gg1 opened 3 years ago

T1gg1 commented 3 years ago

Hello, I have dlib 19.22 installed. But no matter what I do. My Jetson Nano only uses my CPU. If I try it via a pythonscript or via "face_recognition ...." in the commandline. Only CPU

I have installed: Cuda 10.2.300 OpenCV 4.5.3 with compiled CUDA TensorRT 8.0.1.6 cuDNN 8.2.1.32

What can I do to use the GPU?

ishmamt commented 3 years ago

Did you compile dlib from source?

littlebee commented 3 years ago

Same issue here. I did compile DLIB (19.22) from source and checked the CMAKE output for indication that DLIB will use CUDA. According to jtop, GPU is not being used.

jc508 commented 3 years ago

Same issue here. I was trying to bring up a machine using as much pre-installed stuff as possible (seeing the mess I made before trying to upgrade and re-compile everything)

Jetpack 4.6 [LT4 32.6.1] CUDA 10.2.300 Opencv 4.1.1 without CUDA cnDNN 8.2.1.32

dlib.DLIB_USE_CUDA = True dlib version = 19.22.0 dlib compiled = Nov 14 2021 16:36:45 face_recognition.version = 1.2.3 (or 1.3.0 depending on how you ask the question) cv2.version = 4.1.1

Dlib has been compiled and it says -- Enabling CUDA support for dlib. DLIB WILL USE CUDA

Other observations. in python using FacePositions = face_recognition.face_locations(imageRGB ,model="cnn" ) will incur a 15sec freeze the 1st time through, using a 640x360 image.
then whilst it is processing frames the GPU usage reported by jtop is 0%

Thanks JC
Microcontroller_Notes_Jetson_5v0b_log_dlib.txt

jc508 commented 3 years ago

A follow up from my post yesterday - I tried a cure within dlib as outlined in https://forums.developer.nvidia.com/t/issues-with-dlib-library/72600/16 https://medium.com/@ageitgey/build-a-hardware-based-face-recognition-system-for-150-with-the-nvidia-jetson-nano-and-python-a25cb8c891fd these relate to dlib 19.16 and 19.17 but it seems to still apply to 19.22 a one line change, a quick recompile and model="cnn" works now with GPU rocketting to 99% JC

jc508 commented 3 years ago

A second follow up. I regressed dlib to 19.21 and it now works without any modifications. The 1st call to face_recognition.face_locations has dropped from 22 to 25 seconds to 14 or 15 sec for model=cnn JC

memostyles7 commented 2 years ago

you can see the performance of your Jetson Nano with this instructions https://www.seeedstudio.com/blog/2020/07/09/monitor-gpu-cpu-and-other-stats-on-jetson-nano-xavier-nx-tx1-tx2/

liubeichuan commented 9 months ago

第二次跟进。我将 dlib 回归到 19.21,它现在可以在没有任何修改的情况下工作。第一次调用 face_recognition.face_locations 已从 22 秒到 25 秒下降到 14 或 15 秒 model=cnn JC

按照你说的方法,我的速度更加慢了! The way you say, my speed is even slower!