Dawn+CLion on Windows

27 views
Skip to first unread message

Shannon Carey

unread,
Sep 2, 2025, 11:28:49 PMSep 2
to Dawn Graphics
Hi,

I'm an experienced developer, but I don't know C++ or CMake very well. I recently tried following tutorials like https://developer.chrome.com/docs/web-platform/webgpu/build-app , but despite trying to follow the instructions precisely, had a heck of a time getting it working. As soon as I run my exe, I get console output like: "Process finished with exit code -1073741515 (0xC0000135)". I tried many things, but none of them helped.

It was only when I happened to run the exe from CLion in "debug" mode (not "Debug" release but like, with a debugger attached), that I got a meaningful error message, basically, "webgpu_dawn.dll was not found".

It seems that the instructions assume that the built exe will end up in the same directory as webgpu_dawn.dll. However, instead the built DLL was in "./dawn" relative to the exe, therefore it couldn't be found. After doing some searching, I added this to my CMakeLists.txt which fixes the issue by copying the DLL into the same directory as the exe. I don't know if this is the "best" solution, but it works well enough for me.

add_custom_command(TARGET myapp POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:myapp> $<TARGET_FILE_DIR:myapp>
        COMMAND_EXPAND_LISTS
)

I don't know if my scenario is specific to Windows, CMake, or CLion. But it seems like the build config or the tutorial instructions may need some improvement to produce a reliable outcome. In any case, maybe this will help someone else.

I also tried following the instructions in https://dawn.googlesource.com/dawn/+/HEAD/docs/quickstart-cmake.md but those don't seem to work either. I get:

D:\projects\oss\dawn>cmake --install out/Release --prefix install/Release
-- Install configuration: "Release"
CMake Error at out/Release/src/dawn/native/cmake_install.cmake:51 (file):
  file INSTALL cannot find
  "D:/projects/oss/dawn/out/Release/Release/webgpu_dawn.dll": File exists.
Call Stack (most recent call first):
  out/Release/src/dawn/cmake_install.cmake:62 (include)
  out/Release/cmake_install.cmake:62 (include)

Also, during "cmake --build out/Release" I notice a lot of suspicious looking mentions of "Debug" even though it's supposed to be a Release build. For example:

  SPIRV-Tools-static.vcxproj -> D:\projects\oss\dawn\out\Release\third_party\spirv-tools\source\Debug\SPIRV-Tools.lib
  SPIRV-Tools-opt.vcxproj -> D:\projects\oss\dawn\out\Release\third_party\spirv-tools\source\opt\Debug\SPIRV-Tools-opt.
  lib
....
  webgpu_dawn.vcxproj -> D:\projects\oss\dawn\out\Release\Debug\webgpu_dawn.dll

-Shannon

Corentin Wallez

unread,
Sep 8, 2025, 11:15:10 AMSep 8
to Shannon Carey, Dawn Graphics, François Beaufort
Hey Shannon,

+CC Francois to see if the sample app works with the DAWN_BUILD_MONOLITHIC_LIBRARY=SHARED.


On Wed, Sep 3, 2025 at 5:28 AM Shannon Carey <rehe...@gmail.com> wrote:
Hi,

I'm an experienced developer, but I don't know C++ or CMake very well. I recently tried following tutorials like https://developer.chrome.com/docs/web-platform/webgpu/build-app , but despite trying to follow the instructions precisely, had a heck of a time getting it working. As soon as I run my exe, I get console output like: "Process finished with exit code -1073741515 (0xC0000135)". I tried many things, but none of them helped.

It was only when I happened to run the exe from CLion in "debug" mode (not "Debug" release but like, with a debugger attached), that I got a meaningful error message, basically, "webgpu_dawn.dll was not found".

It seems that the instructions assume that the built exe will end up in the same directory as webgpu_dawn.dll. However, instead the built DLL was in "./dawn" relative to the exe, therefore it couldn't be found. After doing some searching, I added this to my CMakeLists.txt which fixes the issue by copying the DLL into the same directory as the exe. I don't know if this is the "best" solution, but it works well enough for me.

add_custom_command(TARGET myapp POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:myapp> $<TARGET_FILE_DIR:myapp>
        COMMAND_EXPAND_LISTS
)

I don't know if my scenario is specific to Windows, CMake, or CLion. But it seems like the build config or the tutorial instructions may need some improvement to produce a reliable outcome. In any case, maybe this will help someone else.

I'm not sure why CMake / CLion wouldn't put the DLL in the same directory. Maybe it is a build vs. install thing? The windows error code really wasn't very helpful in telling what the actual problem was.

 
I also tried following the instructions in https://dawn.googlesource.com/dawn/+/HEAD/docs/quickstart-cmake.md but those don't seem to work either. I get:

D:\projects\oss\dawn>cmake --install out/Release --prefix install/Release
-- Install configuration: "Release"
CMake Error at out/Release/src/dawn/native/cmake_install.cmake:51 (file):
  file INSTALL cannot find
  "D:/projects/oss/dawn/out/Release/Release/webgpu_dawn.dll": File exists.
Call Stack (most recent call first):
  out/Release/src/dawn/cmake_install.cmake:62 (include)
  out/Release/cmake_install.cmake:62 (include)

That seems like it was because you had a leftover install from a previous build, 
 
Also, during "cmake --build out/Release" I notice a lot of suspicious looking mentions of "Debug" even though it's supposed to be a Release build. For example:

  SPIRV-Tools-static.vcxproj -> D:\projects\oss\dawn\out\Release\third_party\spirv-tools\source\Debug\SPIRV-Tools.lib
  SPIRV-Tools-opt.vcxproj -> D:\projects\oss\dawn\out\Release\third_party\spirv-tools\source\opt\Debug\SPIRV-Tools-opt.
  lib
....
  webgpu_dawn.vcxproj -> D:\projects\oss\dawn\out\Release\Debug\webgpu_dawn.dll

-Shannon

--
You received this message because you are subscribed to the Google Groups "Dawn Graphics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dawn-graphic...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dawn-graphics/abfeffbd-f9a6-4f30-9b28-22d429834f47n%40googlegroups.com.

Cheers,

Corentin 

François Beaufort

unread,
Sep 9, 2025, 3:14:39 AMSep 9
to Corentin Wallez, Shannon Carey, Dawn Graphics
On Mon, Sep 8, 2025 at 5:15 PM Corentin Wallez <cwa...@google.com> wrote:
Hey Shannon,

+CC Francois to see if the sample app works with the DAWN_BUILD_MONOLITHIC_LIBRARY=SHARED.

I've tried it locally and it works fine with set(DAWN_BUILD_MONOLITHIC_LIBRARY SHARED).
Shall I update https://github.com/beaufortfrancois/webgpu-cross-platform-app/blob/main/CMakeLists.txt?

Note that the default value just switched from OFF to STATIC: https://dawn-review.googlesource.com/c/dawn/+/261115
 

François Beaufort

unread,
Sep 29, 2025, 4:02:46 AMSep 29
to Corentin Wallez, Shannon Carey, Dawn Graphics
Did this help eventually?
Reply all
Reply to author
Forward
0 new messages