Open johnbchron opened 6 months ago
It sounds like you are correctly using hardware acceleration but maybe a feature that is not supported.
How did you get libGL
? Are you sure it's pointing to the correct Mesa? If you just used nix-shell
or similar it won't be.
How should I be getting libGL
?
It has to use the pkgs
in your system configuration so that the overlay and/or system.replaceRuntimeDependencies
gets applied.
If I use "GLOBAL_LIBGL" = "${pkgs.lib.makeLibraryPath pkgs.libGL}";
to leak the one from my system config, the store path in GLOBAL_LIBGL
is the same as the one in my devshell. I don't know how to tell if it's pointing to the right mesa.
This is not strictly related to WGPU on NixOS but touches on WGPU on Asahi so might be useful.
Using the following repo: https://github.com/jinleili/wgpu-in-app
If you do:
WGPU_BACKEND=gl cargo run --features=angle
You get the same error you got DownlevelFlags(VERTEX_STORAGE)
https://docs.rs/wgpu/latest/wgpu/struct.DownlevelFlags.html#associatedconstant.SURFACE_VIEW_FORMATS
This leads me to believe that even if you link the right driver it is picking it up in OpenGL mode instead of Vulkan mode.
But if you do:
WGPU_BACKEND=vk cargo run --features=vulkan-portability
It renders correctly on M2 Air with Fedora Asahi 39 and the OpenGL 4.6 driver.
Perhaps try this other repo on NixOS with those flags before going directly to Bevy?
Edit: Forgot to mention that I am using overlay mode in my NixOS machine and can try to reproduce any error you get to rule out a system.replaceRuntimeDependencies
issue.
Hi, was wondering if WGPU support is possible? I develop with Bevy which uses WGPU, but it only uses the CPU renderer,
llvmpipe
. As far as I understand we don't have a vulkan driver, so that makes sense. If I addlibGL
to theLD_LIBRARY_PATH
though, I getI generally have hardware acceleration and the output of
glxinfo | grep 'OpenGL renderer string'
isOpenGL renderer string: Apple M2 Pro (G14S B1)
. Not sure what to make of this. My nixos config includesNot sure if I'm doing this config right.
The easiest way to test WGPU is to clone their repo and run their cube example: