Closed HarryWindsor closed 3 years ago
Hi @HarryWindsor, Did you get a chance to go through our GPU documentation. Could you please provide more details like which solution and what is the error you are seeing with the above. Can you point us to the exact links which your referring the above. Thanks!
I am using the face mesh solution and compiled the code with CUDA enabled and face_detection/face_detection_short_range_gpu
, face_detection/face_detection_full_range_gpu
, face_landmark/face_landmark_front_gpu
.
When I run the example from MediaPipe Face Mesh Python Solution API (I don't think another solution behaves differently) I get this output and can validate that the code used the GPU and works, but it always uses GPU 0.
WARNING: Logging before InitGoogleLogging() is written to STDERR
I20210827 11:27:23.775424 347818 gl_context_egl.cc:163] Successfully initialized EGL. Major : 1 Minor: 5
I20210827 11:27:23.809967 347921 gl_context.cc:331] GL version: 3.2 (OpenGL ES 3.2 NVIDIA 470.57.02)
I20210827 11:27:23.810029 347818 gl_context_egl.cc:163] Successfully initialized EGL. Major : 1 Minor: 5
I20210827 11:27:23.833227 347922 gl_context.cc:331] GL version: 3.2 (OpenGL ES 3.2 NVIDIA 470.57.02)
INFO: Created TensorFlow Lite delegate for GPU.
I would prefer to use GPU 1 instead of GPU 0.
Selecting a GPU involves choosing the correct 'EGLDisplay', currently in MediaPipe this is done here.
Notice the eglGetDisplay()
, which defaults to device 0.
You will need to replace eglGetDisplay
with something like eglGetPlatformDisplayEXT
, then have that select device 1.
An example using eglGetPlatformDisplayEXT
can be found here in the #else
part.
There are not currently any plans to integrate this into MediaPipe [yet], but it can be considered in the future.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.
I successfully compiled MediaPipe for CUDA. I use a multi GPU setup and want to run the MediaPipe model on a specific GPU, but MediaPipe always just picks the first GPU. The
CUDA_VISIBLE_DEVICES=1
flag I normally use did not work.How can I select the GPU MediaPipe should run on`