Skip to content

Instantly share code, notes, and snippets.

@cwoffenden
Created February 17, 2022 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwoffenden/0854e5d7732f0bdaf84b6aaeee09b826 to your computer and use it in GitHub Desktop.
Save cwoffenden/0854e5d7732f0bdaf84b6aaeee09b826 to your computer and use it in GitHub Desktop.
Building Dawn/WebGPU for Linux/Power9

Dawn Linux

Work-in-progress and notes for building Dawn for Linux on Power9 (x64 should be easier). Tested on Debian Bullseye.

  1. Depot Tools doesn't work, so CMake appears to be the only way. If this is of further interest Depot Tools fails because some prebuilt binaries aren't available for ppc64le (some are, some are out of date, and some are missing). Building gn manually (see building Chrome) then setting DEPOT_TOOLS_UPDATE=0 allows gn to generate the build scripts but this was still failing. CMake works so don't try any further.
  2. Install all the depdendencies. The ones to build Chrome were already added but also: sudo apt install libx11-dev xcb libxcb-xcb-dev x11-xkb-utils libx11-xcb-dev.
  3. GCC will build but with warnings (mostly ABI changes but also the UNREACHABLE() macro usage needs slightly reworking do be GCC friendly) so install Clang (which is what Dawn is developed with anyway).
  4. Clang needs setting as the default compiler:
    sudo update-alternatives --config c++
    sudo update-alternatives --config cc
  5. Configure CMake to build (with Ninja) as a shared library: cmake -B out/rel -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -G Ninja
  6. Optionally other settings can be configured such as: -DENABLE_OPENGLES=OFF
  7. Build the WebGPU library: ninja -C out/rel webgpu_dawn
  8. This (after a lot of noise from the 144 core Power9!) should have generated libwebgpu_dawn.so, libdawn_native.so and libdawn_platform.so.
  9. Building the sample files currently fails:
    $ ninja -C out/rel
    FAILED: samples/dawn/ComputeBoids 
    /usr/bin/ld: src/dawn/common/libdawn_common.a(SystemUtils.cpp.o): undefined reference to symbol 'dladdr@@GLIBC_2.17'
    /usr/bin/ld: /lib/powerpc64le-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
  10. So far I fixed this manually by passing -ldl on the same command lines showing the failures: ComputeBoids sample

More to come.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment