samdauwe / webgpu-native-examples

Collection of C-language examples that demonstrate basic rendering and computation in WebGPU native.
Apache License 2.0
395 stars 22 forks source link

Compilation error #1

Closed pudnax closed 2 years ago

pudnax commented 2 years ago

running bash build.sh

Generate projects using GN
ERROR at //examples/BUILD.gn:29:1: Dependency not allowed.
static_library("dawn_sample_utils") {
^------------------------------------
The item //examples:dawn_sample_utils
can not depend on //src/common:dawn_internal
because it is not in //src/common:dawn_internal's visibility list: [
  //src/*
]

Build Dawn in Release mode (arch: x86_64)
Running ninja
ninja: Entering directory `out-linux-x86_64/Release'
ninja: error: loading 'build.ninja': No such file or directory
Release build for Dawn failed!
Install Dawn headers
include/dawn directory not found, creating...
directory created at include/dawn
cp: cannot stat '/home/komm/Flush/webgpu-native-examples/external/dawn/dawn/out-linux-x86_64/Release/gen/src/include/dawn/webgpu.h': No such file or directory
cp: cannot stat '/home/komm/Flush/webgpu-native-examples/external/dawn/dawn/out-linux-x86_64/Release/gen/src/include/dawn/dawn_proc_table.h': No such file or directory
cp: cannot stat '/home/komm/Flush/webgpu-native-examples/external/dawn/dawn/out-linux-x86_64/Release/gen/src/include/dawn/webgpu_cpp.h': No such file or directory
include/dawn_native directory not found, creating...
directory created at include/dawn_native
Install Dawn shared libraries
lib directory not found, creating...
directory created at lib
cp: cannot stat '/home/komm/Flush/webgpu-native-examples/external/dawn/dawn/out-linux-x86_64/Release/libc++.so': No such file or directory
cp: cannot stat '/home/komm/Flush/webgpu-native-examples/external/dawn/dawn/out-linux-x86_64/Release/libdawn_native.so': No such file or directory
cp: cannot stat '/home/komm/Flush/webgpu-native-examples/external/dawn/dawn/out-linux-x86_64/Release/libdawn_platform.so': No such file or directory
cp: cannot stat '/home/komm/Flush/webgpu-native-examples/external/dawn/dawn/out-linux-x86_64/Release/libdawn_proc.so': No such file or directory
samdauwe commented 2 years ago

Hi Pudnax,

I also noticed some issues with building Dawn in the last weeks. It is a complex process. For me the Dawn build still works (tested last week), but there is an error while detecting the GPU adapters on my machine that was not there a month ago. In your case the builds fails for a reason I have not seen before.

Normally at the end of the week I have more time to investigate the build issues.

An alternative is to build Dawn using the build instructions in this repo and if you place the generated shared libraries under 'external/dawn/lib' and the headers under 'external/dawn/lib/include' then it normally should work.

Hope it helps, Sam

samdauwe commented 2 years ago

Hi Pudnax,

I made some change to the build system to build Dawn without the build toolchain from depot_tools (GN). Instead the compiler from the host OS is used.

To test the build in a 'controlled' environment I also added support for Docker, please refer to the instructions in the Readme for the required steps.

Feel free to reopen this issue if the build still fails on your side.

Note: running the examples on an Intel(R) HD Graphics 630 (KBL GT2) gives a black screen, maybe it is related to GLFW. I did not find a solution yet. The examples seems to be running find on Intel(R) Iris(R) Plus Graphics 640 (KBL GT3) integrated GPU. With discrete GPUs I also did not have any issues yet.

Best regards, Sam