black window on nixos+nvidia+vulkan #192
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#192
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I am trying to run the example as explained in the project's landing page. However, the triangle is not displayed:

Corresponding terminal output:
I am on NixOS, so I have prepared a Nix flake to satisfy the system dependencies (i.e. X11 and Vulkan). I think there may be an implicit dependency I didn't capture within the Nix flake that does not cause a failure but is necessary to display the triangle? Again, nothing else is reported through standard output except from the above, so I couldn't go any further. If it would help, I can provide the Nix flake I am trying to get this working with.
Hmm, sorry to hear that - it found the Vulkan driver, so I would've expected it to just work.
Could you try with
GPU_BACKEND=opengl zig build run-example?I'd also be curious if you can install a
vulkan-toolspackage and see ifvkcuberuns on your system or not.Interestingly enough, with
GPU_BACKEND=openglit stills picks up Vulkan backend but rather than displaying black window, it immediately segfaults.vkcubeworks without any issues.OK, I see, it looks like we've got a bug in the
gpu/example with the OpenGL backend detection - I can repro on my Linux machine and am working on a fix.Could you see if this other example works for you?
That still reports Vulkan being found, and the output is a black window as it was the case initially:
If I remove the Vulkan stuff from the running environment through Nix, it fails to find Vulkan and panics:
@ozkutuk I can't believe I messed this up, so sorry, the env var is
WGPU_BACKENDnotGPU_BACKENDwhen running from thegpu-dawn/directory, my bad! The correct commands are:Would be very curious to know if that works on your system or not.
In case it helps, the following
shell.nixis what Mitchell Hashimoto needed (putting X11/GL on theLD_LIBRARY_PATH):I'd be keen to know if that fixes the black window issue or not. If not, it's likely the black screen issue is a bug in Dawn upstream
It works! I have a somewhat similar Nix config, though I have migrated to Nix flakes so here is my
flake.nixin case anyone else needs (it also provides a0.10.xversion of the Zig compiler through zig-overlay):I initially had Vulkan related parts in the config, but later removed them as it didn't work for me (I'm still curious as to why it didn't though).
Just to clarify, was it the OpenGL backend that worked? Or Vulkan also worked after that?
OpenGL backend worked with the correct commands you have provided. Unfortunately, still no triangle with the Vulkan backend.
Thanks! I fixed the issue where
GPU_BACKENDin the standardgpu/example was not working, so this should work now.Regarding Vulkan, I see two possibilities here:
${pkgs.vulkan-loader}/libmissing from yourLD_LIBRARY_PATHcould make a difference?Unfortunately, short of installing NixOS on my laptop I'm not sure there's any other way to debug here. I may try that in the future but it'd be a few months.
I have an updated nix flake: