exadel-inc / CompreFace

Leading free and open-source face recognition system
https://exadel.com/accelerator-showcase/compreface/
Apache License 2.0
5.67k stars 773 forks source link

[HELP] Mobilenet-gpu not using GPU #861

Open jswent opened 2 years ago

jswent commented 2 years ago

I have installed and successfully launched the Mobilenet-GPU custom build of compreface but for some reason it is not activating uwsgi on the GPU, rather using the CPU (see the logs). I am running this with Frigate and Double Take. Any help would be greatly appreciated.

OS: Unraid Custom Build: Mobilenet-GPU GPU: NVIDIA Quadro P5000

Docker-compose file: Default Mobilenet-gpu docker-compose.yml

Compreface-core log:

[uWSGI] getting INI configuration from uwsgi.ini
*** Starting uWSGI 2.0.19 (64bit) on [Thu Aug 18 14:36:12 2022] ***
compiled with version: 9.4.0 on 13 July 2022 12:42:33
os: Linux-5.15.46-Unraid #1 SMP Fri Jun 10 11:08:41 PDT 2022
nodename: 2774fb894e84
machine: x86_64
clock source: unix
detected number of CPU cores: 28
current working directory: /app/ml
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
setgid() to 33
setuid() to 33
your processes number limit is 513515
your memory page size is 4096 bytes
detected max file descriptor number: 40960
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 0.0.0.0:3000 fd 3
Python version: 3.8.10 (default, Mar 15 2022, 12:22:08)  [GCC 9.4.0]
Python main interpreter initialized at 0x561360508620
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145808 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
{"severity": "INFO", "message": "{'BUILD_VERSION': 'dev', 'CALCULATION_PLUGIN': 'insightface.Calculator@arcface_mobilefacenet', 'EXTRA_PLUGINS': ['insightface.LandmarksDetector', 'insightface.GenderDetector', 'insightface.AgeDetector', 'insightface.facemask.MaskDetector'], 'FACE_DETECTION_PLUGIN': 'insightface.FaceDetector@retinaface_mnet025_v1', 'GPU_IDX': 0, 'IMG_LENGTH_LIMIT': 640, 'INTEL_OPTIMIZATION': False, 'IS_DEV_ENV': False, 'LOGGING_LEVEL_NAME': 'DEBUG', 'ML_PORT': 3000, 'RUN_MODE': True}", "request": null, "logger": "src.app", "module": "app", "traceback": null, "build_version": "dev"}
{"severity": "DEBUG", "message": "Creating new app for WSGI", "request": null, "logger": "src.app", "module": "app", "traceback": null, "build_version": "dev"}
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x561360508620 pid: 1 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1)
spawned uWSGI worker 1 (pid: 62, cores: 1)

Nvidia-smi output:

Thu Aug 18 07:36:41 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro P5000        Off  | 00000000:C1:00.0 Off |                  Off |
| 32%   50C    P0    45W / 180W |    432MiB / 16384MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      8824      C   ffmpeg                            215MiB |
|    0   N/A  N/A      8828      C   ffmpeg                            215MiB |
+-----------------------------------------------------------------------------+
pospielov commented 2 years ago

Could you clarify, when you do recognition, does it work? Because if you start CompreFace build for GPU on a machine without GPU, it won't work.