!XFRnMvAfptAHthwBCx:matrix.org

Wgpu Users

1055 Members
wgpu users discussion57 Servers

Load older messages


SenderMessageTime
20 Jul 2024
@cwfitzgerald:matrix.orgcwfitzgeraldIf you don't need instancing, you can fake it using instance indexes21:45:00
21 Jul 2024
@rustedshader:matrix.org@rustedshader:matrix.org left the room.10:06:23
@jumerckx:matrix.orgjumerckx joined the room.11:43:50
@jumerckx:matrix.orgjumerckx

Hi! Is anyone succesfully using wgpu natively on WSL? I'm running in all kinds of different errors when trying to run some of the examples. For example, for the msaa_line example I get the following:

[2024-07-21T11:45:21Z INFO  wgpu_examples::framework] Initializing wgpu...
[2024-07-21T11:45:23Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_ENUM in glGetIntegerv(pname=GL_MAX_VERTEX_IMAGE_UNIFORMS)
[2024-07-21T11:45:23Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_ENUM in glGetIntegerv(pname=GL_MAX_FRAGMENT_IMAGE_UNIFORMS)
[2024-07-21T11:45:23Z INFO  wgpu_core::instance] Adapter Gl AdapterInfo { name: "D3D12 (Intel(R) UHD Graphics 630)", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "4.1 (Core Profile) Mesa 22.2.5-0ubuntu0.1~22.04.3", backend: Gl }
[2024-07-21T11:45:23Z INFO  wgpu_examples::framework] Using D3D12 (Intel(R) UHD Graphics 630) (Gl)
[2024-07-21T11:45:23Z INFO  wgpu_examples::framework] Entering event loop...
[2024-07-21T11:45:23Z INFO  wgpu_examples::framework] Surface resume PhysicalSize { width: 800, height: 600 }
[2024-07-21T11:45:23Z INFO  wgpu_core::device::resource] Device::maintain: waiting for submission index 0
[2024-07-21T11:45:23Z ERROR wgpu_hal::gles::egl] EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at wgpu-hal/src/gles/egl.rs:296:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
11:47:32
@bromles:matrix.orgBromles
In reply to @jumerckx:matrix.org

Hi! Is anyone succesfully using wgpu natively on WSL? I'm running in all kinds of different errors when trying to run some of the examples. For example, for the msaa_line example I get the following:

[2024-07-21T11:45:21Z INFO  wgpu_examples::framework] Initializing wgpu...
[2024-07-21T11:45:23Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_ENUM in glGetIntegerv(pname=GL_MAX_VERTEX_IMAGE_UNIFORMS)
[2024-07-21T11:45:23Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_ENUM in glGetIntegerv(pname=GL_MAX_FRAGMENT_IMAGE_UNIFORMS)
[2024-07-21T11:45:23Z INFO  wgpu_core::instance] Adapter Gl AdapterInfo { name: "D3D12 (Intel(R) UHD Graphics 630)", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "4.1 (Core Profile) Mesa 22.2.5-0ubuntu0.1~22.04.3", backend: Gl }
[2024-07-21T11:45:23Z INFO  wgpu_examples::framework] Using D3D12 (Intel(R) UHD Graphics 630) (Gl)
[2024-07-21T11:45:23Z INFO  wgpu_examples::framework] Entering event loop...
[2024-07-21T11:45:23Z INFO  wgpu_examples::framework] Surface resume PhysicalSize { width: 800, height: 600 }
[2024-07-21T11:45:23Z INFO  wgpu_core::device::resource] Device::maintain: waiting for submission index 0
[2024-07-21T11:45:23Z ERROR wgpu_hal::gles::egl] EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at wgpu-hal/src/gles/egl.rs:296:14:
called `Result::unwrap()` on an `Err` value: BadDisplay

If I remember correctly, wgpu functionality is limited on GLES backend. By default, WSL2 only supports OpenGL, GLES and software Vulkan (on CPU). You can force wgpu to use Vulkan backend instead of GLES, and it works for me. But in WSL, Vulkan will be slow due to software implementation.

If you want to use hardware Vulkan on WSL, you can try to set up proper support over DX12. It's somewhat complicated and requires building MESA drivers from source, because it's an experimental feature provided by Microsoft. I spent some time doing it months ago, and eventually got it working. If you are interested, here is the link https://gitlab.freedesktop.org/mesa/mesa/-/issues/6318#note_1459269

Some interesting note: it seems like wgpu prefers to use llvmpipe (software Vulkan) to create an adapter even when hardware implementation over DX12 is available (maybe because it's experimental)

14:26:30
@jumerckx:matrix.orgjumerckx
In reply to @bromles:matrix.org

If I remember correctly, wgpu functionality is limited on GLES backend. By default, WSL2 only supports OpenGL, GLES and software Vulkan (on CPU). You can force wgpu to use Vulkan backend instead of GLES, and it works for me. But in WSL, Vulkan will be slow due to software implementation.

If you want to use hardware Vulkan on WSL, you can try to set up proper support over DX12. It's somewhat complicated and requires building MESA drivers from source, because it's an experimental feature provided by Microsoft. I spent some time doing it months ago, and eventually got it working. If you are interested, here is the link https://gitlab.freedesktop.org/mesa/mesa/-/issues/6318#note_1459269

Some interesting note: it seems like wgpu prefers to use llvmpipe (software Vulkan) to create an adapter even when hardware implementation over DX12 is available (maybe because it's experimental)

Thanks a lot for the information! I use WSL for other development but seems like it's easier to stick to windows for graphics programming for now :)
14:52:27
@bromles:matrix.orgBromles
In reply to @jumerckx:matrix.org
Thanks a lot for the information! I use WSL for other development but seems like it's easier to stick to windows for graphics programming for now :)

It's important to know that WSL is very specific and incompatible with real Linux in many ways (not just graphics). It's a custom Microsoft kernel with many missing system libraries. I encountered numerous "surprises" like the inability to compile Redis from source using it, which real Linux just doesn't have.

And the whole multimedia support is very unconventional - your VMs in WSL2 don't have any support for video or audio themselves. There is a separate, hidden VM called WSLg where there is support, and all your VMs are supposed to talk to it in order to use multimedia. The issue is - many applications for Linux don't support it since usually the system itself provides support (i.e. PulseAudio sockets), and you don't need to go into a separate VM just to use it. That's the reason why so many apps there days have separate "Linux" and "WSL" versions, because WSL just don't support common Linux practices and breaks unprepared software

Based on experience with such cases, I decided to use WSL only for it's shell and common commands. Because with everything else, if it breaks, you will never know is it a problem with software, your system, or just one of WSL quirks. And the closer you try to be to OS in WSL, the more it breaks

15:09:01
@wumpf:matrix.orgwumpfto my continued pain a lot of users of Rerun (that's where I work https://rerun.io/) use our tool and thus wgpu in WSL. Wrote a bit of a troubleshooting guide here that is applicable to wgpu on wsl in general https://rerun.io/docs/getting-started/troubleshooting#wsl2 the bit about nvidia/amd vs intel/amd gpu picking is new and was particularly, ehrm, amusing because it turned out that an outdated amd driver on a mixed nvidia+amd setup caused rendering errors in our application. Now most people sitting on nvidia+amd aren't even aware that they have an amd gpu on their cpu sitting and never update that driver 16:52:53
@wumpf:matrix.orgwumpf * to my continued pain a lot of users of Rerun (that's where I work https://rerun.io/) use our tool and thus wgpu in WSL. Wrote a bit of a troubleshooting guide here that is applicable to wgpu on wsl in general https://rerun.io/docs/getting-started/troubleshooting#wsl2 the bit about nvidia/amd vs intel/amd gpu picking is new and was particularly, ehrm, amusing because it turned out that an outdated amd driver ON THE WINDOWS SIDE of a mixed nvidia+amd setup caused rendering errors in our application. Now most people sitting on nvidia+amd aren't even aware that they have an amd gpu on their cpu sitting and never update that driver 17:04:51
@bromles:matrix.orgBromles
In reply to @jumerckx:matrix.org
Thanks a lot for the information! I use WSL for other development but seems like it's easier to stick to windows for graphics programming for now :)
*

It's important to know that WSL is very specific and incompatible with real Linux in many ways (not just graphics). It's a custom Microsoft kernel with many missing system libraries. I encountered numerous "surprises" like the inability to compile Redis from source using it, which real Linux just doesn't have.

And the whole multimedia support is very unconventional - your VMs in WSL2 don't have any support for video or audio themselves. There is a separate, hidden VM called WSLg where there is support, and all your VMs are supposed to talk to it in order to use multimedia. The issue is - many applications for Linux don't support it since usually the system itself provides support (i.e. PulseAudio sockets), and you don't need to go into a separate VM just to use it. That's the reason why so many apps there days have separate "Linux" and "WSL" versions, because WSL just don't support common Linux practices and breaks unprepared software

Based on experience with such cases, I decided to use WSL only for it's shell and common commands. Because with everything else, if it breaks, you will never know is it a problem with software, your system, or just one of WSL quirks. And the closer you try to be to OS in WSL, the more it breaks

upd: I personally think that this is just another example of Microsoft's beloved EEE strategy to destroy their competition, which they tried multiple times already (https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish)

17:09:24
@bromles:matrix.orgBromles *

It's important to know that WSL is very specific and incompatible with real Linux in many ways (not just graphics). It's a custom Microsoft kernel with many missing system libraries. I encountered numerous "surprises" like the inability to compile Redis from source using it, which real Linux just doesn't have.

And the whole multimedia support is very unconventional - your VMs in WSL2 don't have any support for video or audio themselves. There is a separate, hidden VM called WSLg where there is support, and all your VMs are supposed to talk to it in order to use multimedia. The issue is - many applications for Linux don't support it since usually the system itself provides support (i.e. PulseAudio sockets), and you don't need to go into a separate VM just to use it. That's the reason why so many apps there days have separate "Linux" and "WSL" versions, because WSL just don't support common Linux practices and breaks unprepared software.

Based on experience with such cases, I decided to use WSL only for it's shell and common commands. Because with everything else, if it breaks, you will never know is it a problem with software, your system, or just one of WSL quirks. And the closer you try to be to OS in WSL, the more it breaks.

Upd: I personally think that this is just another example of Microsoft's beloved EEE strategy to destroy their competition, which they tried multiple times already (https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish)

17:10:04
@elabajaba:matrix.orgElabajaba
In reply to @bromles:matrix.org

If I remember correctly, wgpu functionality is limited on GLES backend. By default, WSL2 only supports OpenGL, GLES and software Vulkan (on CPU). You can force wgpu to use Vulkan backend instead of GLES, and it works for me. But in WSL, Vulkan will be slow due to software implementation.

If you want to use hardware Vulkan on WSL, you can try to set up proper support over DX12. It's somewhat complicated and requires building MESA drivers from source, because it's an experimental feature provided by Microsoft. I spent some time doing it months ago, and eventually got it working. If you are interested, here is the link https://gitlab.freedesktop.org/mesa/mesa/-/issues/6318#note_1459269

Some interesting note: it seems like wgpu prefers to use llvmpipe (software Vulkan) to create an adapter even when hardware implementation over DX12 is available (maybe because it's experimental)

At least on ubuntu wsl you might not need to build from source. I've had dzn working with the kisak-mesa ppa before (though it's still slower than just running on windows natively). Unfortunately I reinstalled windows and haven't been able to get it working again.
23:01:25
22 Jul 2024
@gschian0:matrix.org@gschian0:matrix.org left the room.14:23:02
@gschiano:matrix.orggschiano joined the room.15:28:59
@gschiano:matrix.orggschiano set a profile picture.16:20:50
@tommyzjones_20:matrix.org@tommyzjones_20:matrix.org left the room.22:38:58
23 Jul 2024
@chrisvander:matrix.orgChristian van der Loo joined the room.01:59:39
@maxammann:matrix.orgmaxammannI'm out of the loop of what happened around wgpu in the last year. Were any helpers regarding memory management were released? (Either internally or an external crate)16:01:18
@cwfitzgerald:matrix.orgcwfitzgerald
In reply to @maxammann:matrix.org
I'm out of the loop of what happened around wgpu in the last year. Were any helpers regarding memory management were released? (Either internally or an external crate)
Wym? Are you looking for something in particular?
18:17:16
@maxammann:matrix.orgmaxammann
In reply to @cwfitzgerald:matrix.org
Wym? Are you looking for something in particular?
Mostly related to memory management, e.g. i implemented a circular buffer before. I'm not that familiar but it seems like there is some helpers/u told/allocators around vulkan
21:13:49
@cwfitzgerald:matrix.orgcwfitzgerald
In reply to @maxammann:matrix.org
Mostly related to memory management, e.g. i implemented a circular buffer before. I'm not that familiar but it seems like there is some helpers/u told/allocators around vulkan
Stuff like vma is handled internally to wgpu, if you need to suballocate a buffer there is offset-allocator
21:48:43
@maxammann:matrix.orgmaxammannOh so you mean that creating many small buffers in webgpu would be more performance than directly creating those in Vulkan?21:50:54
@maxammann:matrix.orgmaxammann(essentially webgpu offers the benefits as using vma in Vulkan?)21:51:27
24 Jul 2024
@groves:matrix.orggrovesAre there still any known issues around necessary surface drop ordering in wgpu 22? A contributor has a PR to glyphon with this https://github.com/grovesNL/glyphon/blob/279418d810a9593e14065d3b89efa67478a61a66/examples/hello-world.rs#L34-L37 and confirmed that it's still a problem with 2216:21:18
@groves:matrix.orggroves * Are there still any known issues around necessary surface drop order in wgpu 22? A contributor has a PR to glyphon with this https://github.com/grovesNL/glyphon/blob/279418d810a9593e14065d3b89efa67478a61a66/examples/hello-world.rs#L34-L37 and confirmed that it's still a problem with 2216:21:45
@wumpf:matrix.orgwumpfno known issues afaik, plz report + repro21:25:16
25 Jul 2024
@natchuz:matrix.org@natchuz:matrix.org left the room.13:51:54
@sage122:matrix.orgsage122 joined the room.20:08:24
26 Jul 2024
@leonerdo:matrix.orgleonerdoHi, how valid of an approach is it to have only indexes in the vertex buffer and then in the vertex shader access the real data with these indexes from different arrays?07:49:01
@wumpf:matrix.orgwumpf
In reply to @leonerdo:matrix.org
Hi, how valid of an approach is it to have only indexes in the vertex buffer and then in the vertex shader access the real data with these indexes from different arrays?
you can (and probably should 😄) go one step further: don't have a vertex buffer at all and rely on the vertex index alone. Except for this detail you essentially describe "vertex pulling" and it's pretty common practice these days (actually wgpu does pretty much this already on Metal to uphold certain safety guarantees)
10:07:16

There are no newer messages yet.


Back to Room ListRoom Version: 5