gpu-dawn: should not use git submodule (avoid confusion, etc.) #153

Closed
opened 2022-01-08 16:28:28 +00:00 by guidorice · 5 comments
guidorice commented 2022-01-08 16:28:28 +00:00 (Migrated from github.com)

@slimsag I am on MacOS 12.1, zig 0.10.0-dev.2214+5087ec6f4

At the repository root, mach/build.zig the build and test targets are working fine. However I tried the build targets in gpu-dawn/:

mach/gpu-dawn $ zig build
error(compilation): clang failed with stderr: /Users/alex/repos/zig/mach/gpu-dawn/src/dawn/dawn_native_mach.cpp:1:10: fatal error: 'dawn_native/DawnNative.h' file not found
# get the same for error for
zig build install
zig build run-dawn-example

Oddly, the test target succeeds though:

mach/gpu-dawn $ zig build test
All 1 tests passed.

Did I miss a step in the setup/config?

Btw just for context I am a newb, just learning Zig, but longer term I would like to learn WebGPU and contribute to Zig visualization packages.

@slimsag I am on MacOS 12.1, zig 0.10.0-dev.2214+5087ec6f4 At the repository root, `mach/build.zig` the `build` and `test` targets are working fine. However I tried the build targets in `gpu-dawn/`: ``` mach/gpu-dawn $ zig build error(compilation): clang failed with stderr: /Users/alex/repos/zig/mach/gpu-dawn/src/dawn/dawn_native_mach.cpp:1:10: fatal error: 'dawn_native/DawnNative.h' file not found # get the same for error for zig build install zig build run-dawn-example ``` Oddly, the test target succeeds though: ``` mach/gpu-dawn $ zig build test All 1 tests passed. ``` Did I miss a step in the setup/config? Btw just for context I am a newb, just learning Zig, but longer term I would like to learn WebGPU and contribute to Zig visualization packages.
emidoots commented 2022-01-08 23:38:04 +00:00 (Migrated from github.com)

Heya @guidorice ! Your OS and Zig versions are fine.

I should note that gpu-dawn is not ready for prime time yet, most notably:

  1. Windows support hasn't landed yet (coming in the next few weeks)
  2. We're missing the ziggified interface to webgpu.h (the actual API you would use)
  3. The first build times is quite slow (around 2.5 minutes if you're on an M1 mac)
  4. We are using a submodule to clone the Dawn sources, for now. I'd like to eliminate this.

I'm hoping to have all of this fixed in the next month or two, currently.

That fourth point is the issue you ran into: you need to clone the mach/gpu-dawn/libs/dawn Git submodule in the repository.

  • git clone --recursive https://github.com/hexops/mach should do the trick if cloning from scratch.
  • If you've already cloned the repo: git submodule update --init --recursive will do the trick.

Let me know if that helps, and feel free to join the Matrix chat room if you want some more interactive help etc.

Heya @guidorice ! Your OS and Zig versions are fine. I should note that `gpu-dawn` is not ready for prime time yet, most notably: 1. Windows support hasn't landed yet (coming in the next few weeks) 2. We're missing the ziggified interface to `webgpu.h` (the actual API you would use) 3. The first build times is quite slow (around 2.5 minutes if you're on an M1 mac) 4. We are using a submodule to clone the Dawn sources, for now. I'd like to eliminate this. I'm hoping to have all of this fixed in the next month or two, currently. That fourth point is the issue you ran into: you need to clone the `mach/gpu-dawn/libs/dawn` Git submodule in the repository. * `git clone --recursive https://github.com/hexops/mach` should do the trick if cloning from scratch. * If you've already cloned the repo: `git submodule update --init --recursive` will do the trick. Let me know if that helps, and feel free to join the [Matrix chat room](https://matrix.to/#/#hexops:matrix.org) if you want some more interactive help etc.
guidorice commented 2022-01-09 00:59:47 +00:00 (Migrated from github.com)

Hey @slimsag thanks for the reply. Ah yes, I actually knew there were some git submodules, but I forgot the --recursive 🤦🏽

Those are very useful notes about your plans & roadmap. thanks so much!

Not sure I would call it a bug, more user error 😄 At my day job I tend to use git submodules as well- they are convenient, but also one more thing for the dev to pay attention to, as shown by my forgetting.

I am running the build target now, but near the end it complained about

./src/dawn/hello_triangle.zig:117:33: error: expected type '*anyopaque', found 'type'
    setup.window.setUserPointer(CallbackPayload, &.{ .swap_chain = swap_chain, .swap_chain_format = swap_chain_format });
                                ^

I will dig into that. Hunting down compiler errors, and linter errors, is the best way to learn.

Hey @slimsag thanks for the reply. Ah yes, I actually knew there were some git submodules, but I forgot the `--recursive` 🤦🏽 Those are very useful notes about your plans & roadmap. thanks so much! Not sure I would call it a `bug`, more user error 😄 At my day job I tend to use git submodules as well- they are convenient, but also one more thing for the dev to pay attention to, as shown by my forgetting. I am running the build target now, but near the end it complained about ``` ./src/dawn/hello_triangle.zig:117:33: error: expected type '*anyopaque', found 'type' setup.window.setUserPointer(CallbackPayload, &.{ .swap_chain = swap_chain, .swap_chain_format = swap_chain_format }); ^ ``` I will dig into that. Hunting down compiler errors, and linter errors, is the best way to learn.
emidoots commented 2022-01-09 01:05:33 +00:00 (Migrated from github.com)

Not sure I would call it a bug, more user error 😄

I consider this a quite serious bug :) Hopefully that gives you some indication of the level of "good out of the box experience" that I expect us to have.

near the end it complained about

Ohh, good catch.. I think we will need to update hello_triangle.zig to account for the changes in #152 which happened a few days ago. Feel free to send a PR for this, otherwise I'll get to it in the next day or so.

> Not sure I would call it a bug, more user error 😄 I consider this a quite serious bug :) Hopefully that gives you some indication of the level of "good out of the box experience" that I expect us to have. > near the end it complained about Ohh, good catch.. I think we will need to update `hello_triangle.zig` to account for the changes in #152 which happened a few days ago. Feel free to send a PR for this, otherwise I'll get to it in the next day or so.
guidorice commented 2022-01-09 21:20:24 +00:00 (Migrated from github.com)

@slimsag I am preparing a PR now.

@slimsag I am preparing a PR now.
emidoots commented 2022-02-20 21:35:30 +00:00 (Migrated from github.com)

gpu-dawn now automagically ensures Git submodules are cloned at the right revision as part of zig build: github.com/hexops/mach@d32cc38a57/gpu-dawn/build.zig (L180-L186)

`gpu-dawn` now automagically ensures Git submodules are cloned at the right revision as part of `zig build`: https://github.com/hexops/mach/blob/d32cc38a5749981038be90f51b90f52ef3c08705/gpu-dawn/build.zig#L180-L186
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#153
No description provided.