-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Hundreds of webgpu compilation errors with mediapipe sources... #24253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I made the code compilable. I had to use lot of ifdefs because emscripten webgpu headers are quite outdated. Device limits, features, pipeline creation, textures uploading / copying... This is just part of API which is not compatible in latest emscripten and latest dawn headers. |
MediaPipe uses emdawnwebgpu, a newer fork of the bindings, not the bindings that are built into Emscripten (the ones you get if you use |
If there is MediaPipe build documentation or build files you were using that did the wrong thing, can you file a bug with MediaPipe and @ me on it? |
i'm using custom build system using cmake. Will try to use emdawnwebgpu. Thank you for the help. |
Unfortunately i coudn't make emdawn port working. -- Looking for sys/types.h |
That might be https://crbug.com/415850603 |
Never mind, that's not it, this is a different issue. It may be because MediaPipe hasn't been tested with |
It's not related to mediapipe build system. As i mentioned i'm using custom build system with lot of projects. And mediapipe is one of them. With this line added cmake just failing to compile any c++ test code. And throwing fatal error at the beginning of setup (abseil-cpp project). P.S. tried latest port version from 7th of Mai - the same errors. |
Probably the issue in emscripten cmake tools (like Emscripten.cmake). |
I analyzed cmake error logs and found this line:
So i removed -s USE_WEBGPU and abseil cmake setup succeed, but it failed in another place: -- Cross-compiling to test HAVE_STD_REGEX And it looks like beanchmark project is failing any check step. Will investigate the logs... |
Ok, i had to remove port line from linker cmake flags (CMAKE_EXE_LINKER_FLAGS), otherwise it complains:
Now cmake is succesfully generated ninja project. Hope it will be linkable in the end of compilation... |
Glad you've solved the issues so far! Please feel free to post again here or file a Dawn bug if you encounter more issues. It's useful to have these errors written down somewhere so search engines pick them up for people who have issues in the future. |
Hello,
I'm trying to compile latest mediapipe for WASM and compiler throws lot of errors during compiling of WebGPU related code:
/mediapipe/gpu/webgpu/webgpu_service.cc:79:60: error: member reference base type 'const char *' is not a structure or union
79 | adapter_info_.device.length = strlen(adapter_info_.device.data);
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/mediapipe/gpu/webgpu/webgpu_service.cc:80:23: error: member reference base type 'const char *' is not a structure or union
80 | adapter_info_.vendor.data = GetAdapterVendor();
/mediapipe/gpu/webgpu/webgpu_utils.cc:30:17: error: no member named 'capabilities' in 'wgpu::InstanceDescriptor'
30 | instance_desc.capabilities.timedWaitAnyEnable = true;
| ~~~~~~~~~~~~~ ^
/mediapipe/gpu/webgpu/webgpu_utils.cc:93:53: error: no member named 'WaitAny' in 'wgpu::Instance'
93 | wgpu::WaitStatus wait_status = kWebGpuInstance->WaitAny(
| ~~~~~~~~~~~~~~~~~^
/mediapipe/gpu/webgpu/webgpu_utils.cc:159:58: error: no type named 'StringView' in namespace 'wgpu'
159 | wgpu::ComputePipeline pipeline, wgpu::StringView message) {
| ~~~~~~^
/mediapipe/gpu/webgpu/webgpu_utils.cc:157:19: error: cannot initialize a parameter of type 'CreateComputePipelineAsyncCallback' (aka 'void (*)(WGPUCreatePipelineAsyncStatus, WGPUComputePipelineImpl *, const char *, void )') with an rvalue of type 'wgpu::CallbackMode'
157 | descriptor, wgpu::CallbackMode::WaitAnyOnly,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\emsdk\upstream\emscripten\cache\sysroot/include\webgpu/webgpu_cpp.h:945:122: note: passing argument to parameter 'callback' here
945 | void CreateComputePipelineAsync(ComputePipelineDescriptor const * descriptor, CreateComputePipelineAsyncCallback callback, void * userdata) const;
| ^
/mediapipe/gpu/webgpu/webgpu_utils.cc:187:57: error: no type named 'StringView' in namespace 'wgpu'
187 | wgpu::RenderPipeline pipeline, wgpu::StringView message) {
| ~~~~~~^
/mediapipe/gpu/webgpu/webgpu_utils.cc:185:19: error: cannot initialize a parameter of type 'CreateRenderPipelineAsyncCallback' (aka 'void ()(WGPUCreatePipelineAsyncStatus, WGPURenderPipelineImpl *, const char *, void *)') with an rvalue of type 'wgpu::CallbackMode'
185 | descriptor, wgpu::CallbackMode::WaitAnyOnly,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\emscripten\cache\sysroot/include\webgpu/webgpu_cpp.h:950:119: note: passing argument to parameter 'callback' here
950 | void CreateRenderPipelineAsync(RenderPipelineDescriptor const * descriptor, CreateRenderPipelineAsyncCallback callback, void * userdata) const;
| ^
/mediapipe/gpu/webgpu/webgpu_utils.cc:273:9: error: no type named 'TexelCopyTextureInfo' in namespace 'wgpu'
273 | wgpu::TexelCopyTextureInfo destination = {.texture = texture};
| ~~~~~~^
/mediapipe/gpu/webgpu/webgpu_utils.cc:274:9: error: no type named 'TexelCopyBufferLayout' in namespace 'wgpu'
274 | wgpu::TexelCopyBufferLayout texel_copy_buffer_layout = {
| ~~~~~~^
/mediapipe/gpu/webgpu/webgpu_utils.cc:319:9: error: no type named 'TexelCopyTextureInfo' in namespace 'wgpu'
319 | wgpu::TexelCopyTextureInfo copy_src{.texture = texture};
| ~~~~~~^
/mediapipe/gpu/webgpu/webgpu_utils.cc:320:9: error: no type named 'TexelCopyBufferInfo' in namespace 'wgpu'
320 | wgpu::TexelCopyBufferInfo copy_dst{.layout = {.bytesPerRow = bytes_per_row},
Seems like it throws errors on any function in wgpu Scope. I'm using -s USE_WEBGPU=1 for cmake setup.
Included all possible emscripten wgpu related headers:
#include <emscripten.h>
#include <emscripten/em_js.h>
#include <webgpu/webgpu_cpp.h>
#include <emscripten/html5_webgpu.h>
Not sure what is wrong.
P.S. The code is compilable in windows using dawn.
The text was updated successfully, but these errors were encountered: