maierfelix / webgpu

WebGPU for Node [Deprecated, Unmaintained]
MIT License
244 stars 17 forks source link

"npm run all" fail: "dawn/webgpu.h": No such file or directory #7

Closed yyc-git closed 4 years ago

yyc-git commented 4 years ago

Hello @maierfelix , Thanks For your project!

My environment: windows7 vs2019 graphics card is rtx 2060s vulkan sdk version is 1.1.126.0

1、I have successfully build dawn-ray-tracing project:

a)install depot_tools b)Then get the source as follows:

git clone https://github.com/maierfelix/dawn-ray-tracing.git && cd dawn-ray-tracing
cp scripts/standalone.gclient .gclient
gclient sync

c)build:

gn gen out/Shared --ide=vs --target_cpu="x64" --args="is_component_build=true is_debug=false is_clang=false"
ninja -C out/Shared

2、I have add PATH_TO_DAWN in webgpu's root successfully.

file content like this:

../dawn-ray-tracing

3、try to build webgpu project:

package.json ->  add:
  "dependencies": {
    "@cwasm/lodepng": "^0.1.3",
    "gl-matrix": "^3.2.1"
  }

npm install

//because can't find python, so I set the --python!
npm run all --dawnversion=0.0.1 --python="C:\Users\Administrator\Downloads\depot_tools\bootstrap-3_8_0_chromium_8_bin\python\bin\python.exe"

now I have fail:

D:\Github\webgpu-master>npm run build --dawnversion=0.0.1 --python="C:\Users\Administrator\Downloads\depot_tools\bootstrap-3_8_0_chromium_8_bin\python\bin\python.exe"

> webgpu@0.1.1 build D:\Github\webgpu-master
> node ./build.js

Compiling bindings for version 0.0.1...
Platform: win32 | x64
Node: 12.16.1
V8: 7.8.279.23-node.31

Compiling bindings..

D:\Github\webgpu-master\generated\0.0.1\win32>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-g
yp\bin\node-gyp.js" configure )
Warning: Missing input files:
D:\Github\webgpu-master\generated\0.0.1\win32\build\..\src\*.cpp

D:\Github\webgpu-master\generated\0.0.1\win32>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\b
in\node-gyp.js" build )
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(459,5): warning MSB8028: The intermediate directory (Release\obj\action_after_build\) contains files shared from another project (action_after_build.vcxproj).  This can lead to incorre
ct clean and rebuild behavior. [D:\Github\webgpu-master\generated\0.0.1\win32\build\action_after_build.vcxproj]
  BackendBinding.cpp
  D3D12Binding.cpp
  DescriptorDecoder.cpp
  GPU.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\BackendBinding.h(18,10): fatal error C1083: ????????: "dawn/webgpu.h": No such file or directory (????? ..\src\BackendBinding.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
D:\Github\webgpu-master\generated\0.0.1\win32\src\BackendBinding.h(18,10): fatal error C1083: ????????: "dawn/webgpu.h": No such file or directory (????? ..\src\D3D12Binding.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\DescriptorDecoder.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPU.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPUAdapter.cpp
  GPUBindGroup.cpp
  GPUBindGroupLayout.cpp
  GPUBuffer.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUBindGroup.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUBuffer.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPUCanvasContext.cpp
  GPUCommandBuffer.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUBindGroupLayout.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUAdapter.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPUCommandEncoder.cpp
  GPUComputePassEncoder.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUCanvasContext.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPUComputePipeline.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUCommandBuffer.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPUDevice.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUCommandEncoder.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPUFence.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUComputePassEncoder.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPUPipelineLayout.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUComputePipeline.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPUQueue.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUDevice.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPURayTracingAccelerationContainer.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUFence.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPURayTracingPassEncoder.cpp
D:\Github\webgpu-master\generated\0.0.1\win32\src\Base.h(6,10): fatal error C1083: ????????: "dawn/dawn_proc.h": No such file or directory (????? ..\src\GPUPipelineLayout.cpp) [D:\Github\webgpu-master\generated\0.0.1\win32\build\addon-win32.vcxproj]
  GPURayTracingPipeline.cpp
Terminate batch job (Y/N)? ^C

How to solve the Error??? Thanks very much!

maierfelix commented 4 years ago

Hey,

PATH_TO_DAWN must be an absolute path to the location of dawn. I've added an error message with https://github.com/maierfelix/webgpu/commit/48495e175a0da8614c41bb7c1754ca83103303f6.

yyc-git commented 4 years ago

@maierfelix Thanks for your reply! Yes, it work!