Skip to content

Targetting wasm-32-wasmrt-webgpu seems to require native webgpu too? #8063

Closed
@ziriax

Description

@ziriax

I was trying to modify the HelloWasm app to use WebGPU for running in a browser.

But CMake fails:

Could NOT find Halide_WebGPU (missing: Halide_WebGPU_NATIVE_LIB)

Why is Halide_WebGPU_NATIVE_LIB required when targetting the web browser?

The command that fails is:

set(target "wasm-32-wasmrt-webgpu")
set(config "wasm")

foreach (gen IN ITEMS init update render)
    add_halide_library(${config}_${gen} FROM reaction_diffusion_generator
                        GENERATOR reaction_diffusion_${gen}
                        FUNCTION_NAME reaction_diffusion_${gen}
                        PARAMS threads=false
                        TARGETS ${target})
endforeach ()

After the following fix in HalideGeneratorHelpers.cmake, it worked:

if ("${ARGN}" MATCHES "webgpu")
if ("${ARGN}" MATCHES "host-webgpu")

PS: However, the wasn't enough to actually make the app use WebGPU (how can I know?), so more help is appreciated 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    backport meThis change should be backported to release versions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions