mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

error message : "gcc: error: unrecognized command-line option '-mavxvnniint8'; did you mean '-mavxvnni’?"

Open akau16 opened this issue 11 months ago • 7 comments

OS Platform and Distribution

Windows 11 WSL2(Ubuntu 22.04.5 LTS)

Compiler version

gcc 11.4.0 / g++ 11.4.0

Programming Language and version

C++17

Installed using virtualenv? pip? Conda?(if python)

Windows 11 WSL2(Ubuntu 22.04.5 LTS)

MediaPipe version

No response

Bazel version

v1.25.0

XCode and Tulsi versions (if iOS)

No response

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

3.4.20

Describe the problem

gcc: error: unrecognized command-line option '-mavxvnniint8'; did you mean '-mavxvnni’?

Complete Logs

To build, for example, the C++ example app of the legacy MediaPipe Hand Detection solution with CPU, run:

bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu

and it show 

ERROR: /home/davidshiu0316/.cache/bazel/_bazel_davidshiu0316/682fbe615818a463bd3f18a2ef38cf0a/external/XNNPACK/BUILD.bazel:661:36: Compiling src/qs8-qc8w-igemm/gen/qs8-qc8w-igemm-1x8c8-minmax-fp32-avxvnniint8-prfm.c failed: (Exit 1): gcc failed: error executing command (from target @XNNPACK//:avxvnniint8_prod_microkernels) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 97 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '-mavxvnniint8'; did you mean '-mavxvnni'?
ERROR: /home/davidshiu0316/.cache/bazel/_bazel_davidshiu0316/682fbe615818a463bd3f18a2ef38cf0a/external/XNNPACK/BUILD.bazel:661:36: Compiling src/qs8-qc8w-gemm/gen/qs8-qc8w-gemm-5x8c8-minmax-fp32-avxvnniint8-prfm.c failed: (Exit 1): gcc failed: error executing command (from target @XNNPACK//:avxvnniint8_prod_microkernels) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 97 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '-mavxvnniint8'; did you mean '-mavxvnni'?
Target //mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.030s, Critical Path: 0.40s
INFO: 134 processes: 130 internal, 4 linux-sandbox.
FAILED: Build did NOT complete successfully

akau16 avatar Dec 26 '24 05:12 akau16

I have the same issue with Ubuntu 22.04 and gcc-12, I tried gcc-13, but I got another error from compiling XNNPACK: Compiling src/qs8-qc8w-gemm/gen/qs8-qc8w-gemm-1x8c8-minmax-fp32-avxvnniint8-prfm.c failed: (Exit 1): gcc failed: error executing command (from target @XNNPACK//:avxvnniint8_prod_microkernels) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 98 arguments skipped) /tmp/cc2TKdd0.s: Assembler messages: /tmp/cc2TKdd0.s:78: Error: no such instruction: vpdpbssd -1024(%rax),%ymm0,%ymm7' /tmp/cc2TKdd0.s:79: Error: no such instruction: vpdpbssd -992(%rax),%ymm0,%ymm6' /tmp/cc2TKdd0.s:81: Error: no such instruction: vpdpbssd -960(%rax),%ymm4,%ymm0' /tmp/cc2TKdd0.s:82: Error: no such instruction: vpdpbssd -928(%rax),%ymm4,%ymm5' /tmp/cc2TKdd0.s:98: Error: no such instruction: vpdpbssd -64(%r14),%ymm4,%ymm7' /tmp/cc2TKdd0.s:99: Error: no such instruction: vpdpbssd -32(%r14),%ymm4,%ymm6'

jfulem avatar Jan 17 '25 13:01 jfulem

Could you please ask if the problem has been solved? I have encountered the same problem.

sunmooncode avatar Mar 05 '25 09:03 sunmooncode

I compiled XNNPACK by cmake and used that as a local repository in Mediapipe Bazel. Unfortunately, I was not able to compile XNNPACK by Bazel.

jfulem avatar Mar 05 '25 14:03 jfulem

I solved the problem by increasing this parameter, which has no effect on functional testing. --define xnn_enable_avxvnniint8=false

sunmooncode avatar Mar 06 '25 09:03 sunmooncode

gcc: error: unrecognized command-line option '-mavx512fp16'; did you mean '-mavx512bf16'?

jinpengfei avatar Mar 27 '25 05:03 jinpengfei

A full list that finally gets the build running in the docker image:

--define xnn_enable_avx512amx=false
--define xnn_enable_avxvnniint8=false
--define xnn_enable_avxvnni=false
--define xnn_enable_avx512fp16=false

physxP avatar May 27 '25 17:05 physxP

Same problem on my Debian 12 with gcc-v12

Checked the CMakeList.txt IF(CMAKE_C_COMPILER_ID STREQUAL "GNU") IF(CMAKE_C_COMPILER_VERSION VERSION_LESS "17") SET(XNNPACK_ENABLE_AVXVNNIINT8 OFF) ENDIF()

do it correct.

but the bzl build isn't right.

ruehlchris avatar Jun 03 '25 08:06 ruehlchris

I had the same issue, but compiling XNNPACK. The solution is to use GCC 13, which is the version where avxvnniint8 and other required options were introduced.

mmajchrzycki avatar Jun 25 '25 09:06 mmajchrzycki

I solved this issue with this option

-c opt --define MEDIAPIPE_DISABLE_GPU=0 --copt="-march=native" --define xnn_enable_avxvnni=false --define xnn_enable_avxvnniint8=false

whdtjr avatar Jul 23 '25 13:07 whdtjr