mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

FaceMesh GPU BUILD ERROR: Linking mediapipe/framework/tool/encode_as_c_string [for host] failed

Open robi56 opened this issue 3 years ago • 3 comments

FaceMesh GPU Build

I have sucessfully build FaceMesh for CPU using the following command
BUILD for CPU

bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu

But for BUILD for GPU, I got undefined reference to symbol 'nan@@GLIBC_2.2.5' error

GPU BUILD Command

bazel build -c opt --config=cuda --spawn_strategy=local --define no_aws_support=true --copt -DMESA_EGL_NO_X11_HEADERS mediapipe/examples/desktop/face_mesh:face_mesh_gpu

Error Details

ERROR: /home/turing/GPU_MediaPIPE/mediapipe/mediapipe/framework/tool/BUILD:109:10: Linking mediapipe/framework/tool/encode_as_c_string [for host] failed: (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc @bazel-out/host/bin/mediapipe/framework/tool/encode_as_c_string-2.params /usr/bin/ld: bazel-out/host/bin/external/com_google_absl/absl/strings/libstrings.a(charconv.o): undefined reference to symbol 'nan@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Target //mediapipe/examples/desktop/face_mesh:face_mesh_gpu failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 100.569s, Critical Path: 59.76s INFO: 820 processes: 209 internal, 611 local. FAILED: Build did NOT complete successfully

robi56 avatar Sep 09 '22 03:09 robi56

I have add cc_binary( ... linkopts = ["-lm"], ) in BUILD file [/mediapipe/examples/desktop/face_mesh/BUILD]


cc_binary(
    name = "face_mesh_gpu",
    data = ["//mediapipe/modules/face_landmark:face_landmark_with_attention.tflite"],
    deps = [
        "//mediapipe/examples/desktop:demo_run_graph_main_gpu",
        "//mediapipe/graphs/face_mesh:desktop_live_gpu_calculators",
    ],
   linkopts = ["-lm"],
)

following the solution, SOLUTION

But still got the same error

robi56 avatar Sep 09 '22 03:09 robi56

Hi @robi56 , it's good that the GPU path works for facemesh when refine_landmarks is false, that means the mediapipe GPU configuration/setup is fine.

the refine_landmarks = true option actually runs a different ML model (here)

it seems that model has some op that isn't compatible with the tensorflow gpu delegate.

sureshdagooglecom avatar Sep 14 '22 08:09 sureshdagooglecom

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.

google-ml-butler[bot] avatar Sep 21 '22 08:09 google-ml-butler[bot]

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] avatar Sep 28 '22 09:09 google-ml-butler[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Sep 28 '22 09:09 google-ml-butler[bot]