Skip to content
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

Compiling dawn error: set_property could not find TARGET update_mappings #7

Closed
rollschild opened this issue May 7, 2023 · 9 comments

Comments

@rollschild
Copy link

Hi,

First of all thanks for this cool project! I've been following the Learn WebGPU, although it's still WIP it's been very useful so far! And I'm amazed by how quickly bugs got fixed. Previously I ran into the markupsafe missing error but I noticed that it had been already fixed.

I'm seeing another error right now while compiling dawn on Linux (NixOS) for Wayland:

CMake Error at webgpu/cmake/FetchDawn.cmake:77 (set_property):
  set_property could not find TARGET update_mappings.  Perhaps it has not yet
  been created.
Call Stack (most recent call first):
  webgpu/CMakeLists.txt:21 (make_dawn_available)

I see that it was due to set_property(TARGET update_mappings PROPERTY FOLDER "External/GLFW3") in webgpu/cmake/FetchDawn.cmake but I'm not sure how to fix it. Could you please help? Thanks!

@eliemichel
Copy link
Owner

eliemichel commented May 7, 2023

Okey I guess we can wrap this in some if (TARGET update_mappings) because the existence of the target may depend on the OS! (This line is just here so that target are well organized visually in an IDE, not super important)

@rollschild
Copy link
Author

@eliemichel Thanks for the tip! Build succeeded. Ran into another error at run time. Not sure if it's me or something else. I will open another issue if I couldn't figure it out myself.

@rollschild
Copy link
Author

Well, during cmake . -B build, I saw the following log:

-- Dawn build Wayland support: OFF
-- Dawn build X11 support: ON

Does it mean wayland support for Dawn is turned off?

@eliemichel
Copy link
Owner

eliemichel commented May 8, 2023

Oh, I think you can simply add set(DAWN_USE_WAYLAND ON) at the beginning of your CMakeLists.txt.

Do you know if there is a way to automatically figure out in CMake whether the build targets a Wayland environment? If so I will add this automatically in FetchDawn.cmake

(Also, if you don't want to restart the build from scratch, look for DAWN_USE_WAYLAND:BOOL=OFF in build/CMakeCache.txt and switch is to ON.)

@eliemichel eliemichel reopened this May 8, 2023
@rollschild
Copy link
Author

@eliemichel Hey thanks for the reply. Actually last night I found this line in Dawn's source code CMakeLists.txt so I manually set(DAWN_USE_WAYLAND ON) in FetchDawn.cmake and it did fix this error.

However there is another issue - I'm not near my personal laptop right now but it's something like Vulkan could not be loaded, while requesting the adapter. Strangely, after this error message, adapter was successfully requested but with value 0 - I think it's the nullptr value it was initialized with.

I thought they were part of the same issue so I didn't rush to post an update here. I may need to take a little while to further troubleshoot this but this is as far as I could go right now. Thank you!

@eliemichel
Copy link
Owner

Did you check whether other vulkan-based program run correctly on your system?

@rollschild
Copy link
Author

@eliemichel You are right. I pulled in some vulkan dependencies and now it's working. Instance created. Surface created. Adapter requested with non-zero value. There are only two warnings, which I think are probably fine.

Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 0.  Skipping ICD.
Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 3.  Skipping ICD.

And these are the Adapter features logged:

Adapter features:
 - 5
 - 6
 - 7
 - 4
 - 3
 - 1006
 - 1
 - 2
 - 1005
 - 8
 - 10
 - 11
 - 1002
 - 1004
 - 1007

@eliemichel
Copy link
Owner

Nice :) For the record, can you give some details about "pulling in some vulkan dependencies"? Anything worth sharing to other people in a similar situation that I could add to the guide?

@rollschild
Copy link
Author

@eliemichel Sure. I'm using NixOS and this is a flake-based project. My flake.nix is here. Basically it pins any dependencies that are needed for the particular project.

The Vulkan dependencies that I added are:

            # vulkan 
            glslang # or shaderc
            vulkan-headers
            vulkan-loader
            vulkan-validation-layers # maybe?
            vulkan-tools

(Note: there are definitely unnecessary dependencies in my flake.nix but this is what works for me for now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants