Closed pjoe closed 4 years ago
Unfortunately even with LD_LIBRARY_PATH
set manually I get a segfault when tryig the raytracing sample :cry:
Trying hello-triangle.mjs
:
$ LD_LIBRARY_PATH=`pwd`/node_modules/webgpu/generated/0.0.1/linux/build/Release node hello-triangle.mjs
(node:18425) ExperimentalWarning: The ESM module loader is experimental.
X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
Major opcode of failed request: 149 ()
Minor opcode of failed request: 4
Resource id in failed request: 0x300000d
Serial number of failed request: 197
Current serial number in output stream: 203
FYI: on ubuntu 19.10, laptop with RTX-2070, driver nvidia-435
Thanks for reporting, I'll try to resolve this ASAP
The README has directions for setting the LD_LIBRARY_PATH, and installing libvulkan. Please report your version of libvulkan.
This is what dpkg tells me:
ii libvulkan1:amd64 1.1.114.0-1 amd64 Vulkan loader library
I upgraded to webgpu 0.1.4, but still getting error on hello-triangle, running like this:
$ LD_LIBRARY_PATH=`pwd`/node_modules/webgpu/generated/0.0.1/linux/build/Release node hello-triangle.mjs
(node:6008) ExperimentalWarning: The ESM module loader is experimental.
X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
Major opcode of failed request: 149 ()
Minor opcode of failed request: 4
Resource id in failed request: 0x3c0000d
Serial number of failed request: 197
Current serial number in output stream: 203
Using node v13.11.0
if that matters.
vulkaninfo
seems to return ok info, but vkcube just show a black window (no crash though. I am using an optimus laptop (both nVIDA and Intel GPU) - dunno if that may be related.
Found this related to optimus: https://forums.developer.nvidia.com/t/on-optimus-system-vulkan-tries-to-use-integrated-intel-graphics-and-fails-with-a-blank-black-window/79257.
After disabling the Intel icd, then hello-triangle seems to work, showing a nice red triangle.
Trying to run the ray-tracing sample almost crashed the whole system :S
The ubuntu crash reporter show: node crashed with SIGSEGV in dawn_native::vulkan::Buffer::TransitionUsageNow()
Guessing this may be related to drivers. The nVidia control panel show driver version to be 435.21
The latest npm package should fix this now.
@pjoe The RT example is broken on linux and I'm currently investigating into this. Can this issue be closed now?
I really don't think it should be necessary to set library path when just consuming the npm module. I've never had to deal with library path before with other npm modules.
Maybe it's a matter of the right rpath, dunno if it helps but found this: https://github.com/nodejs/node-v0.x-archive/issues/25627#issuecomment-172804743
@dcerisano I already had libvulkan installed.
Also if you look at the LD_DEBUG output, it is not libvulkan, but libdawn_native it is failing to find. And it is searching for paths that looks local to Felix's machine, which doesn't seem ideal to me :)
What then worked for me was to point LD_LIBRARY_PATH like this:
LD_LIBRARY_PATH=`pwd`/node_modules/webgpu/generated/0.0.1/linux/build/Release
i.e. pointing to a folder inside the installed node module. This I really don't think should be necessary.
I think this can be fixed with the right rpath setting (probably here: https://github.com/maierfelix/webgpu/blob/master/generated/0.0.1/linux/binding.gyp#L102).
I had this issue with past projects too, .gyp
files are horrible to work with. I'm not sure what's the best fix for this, but eventually by setting the environment variable manually in the index.js
file in this project?
Something like this:
if (process.platform === "linux") {
if (!process.env.hasOwnProperty("LD_LIBRARY_PATH ")) {
process.env.LD_LIBRARY_PATH = require("path").join(__dirname, `${generatedPath}/build/Release/`);
}
}
Unfortunately I don't think it works to set LD_LIBRARY_PATH
like that - at least I was unable to get that working in this case, when I originally tried. Anyway I will try to see if this can't be handled by tweaking rpath
. Will do a PR if i get it working, but suggest we keep this issue open for now.
Should be fixed in 0.1.6, can you approve @pjoe ?
Unfortunately still not working with 0.1.7.
Relevant output from LD_DEBUG:
(node:7148) ExperimentalWarning: The ESM module loader is experimental.
7148: find library=libdawn_native.so [0]; searching
7148: search path=/home/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build
/Release/tls/haswell/x86_64:/home/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build/
Release/tls/haswell:/home/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build/Release/
tls/x86_64:/home/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build/Release/tls:/home
/user/Documents/GitHub/webgpu/generated/0.0.1/linux/build/Release/haswell/x86_64:/home/user
/Documents/GitHub/webgpu/generated/0.0.1/linux/build/Release/haswell:/home/user/Documents/G
itHub/webgpu/generated/0.0.1/linux/build/Release/x86_64:/home/user/Documents/GitHub/webgpu/
generated/0.0.1/linux/build/Release (RPATH from file /home/pelle/test/webgpu/no
de_modules/webgpu/generated/0.0.1/linux/build/Release/addon-linux.node)
Please re-open
Trying to run the samples, it fails to load the
libdawn_native.so
. SettingLD_LIBRARY_PATH
manually fixes this.Debugging with
LD_DEBUG=libs
gives me: