zig-gamedev / zgpu

Cross-platform graphics lib for Zig built on top of Dawn native WebGPU implementation.
MIT License
4 stars 2 forks source link

100% CPU used on some linux setups #2

Open pfgithub opened 1 month ago

pfgithub commented 1 month ago

Any wgpu sample uses 100% of one cpu core on linux, even though the time to render and display the frame is less than that

zig build triangle_wgpu-run # uses 100% cpu
zig build minimal_glfw_gl-run # barely uses any cpu

In tracy sampling, it seems like it might be spending all its time on gctx.device.tick inside zgpu.GraphicsContext.uniformsNextStagingBuffer.

screenshot of tracy

This could possibly be an issue specific to the i3 window manager, I haven't tested in any other wm.

hazeycode commented 1 month ago

No repro running popOS with X11 and radv Mesa 24.0.3-1 driver.

citruslee commented 1 week ago

can concur, 5% CPU across all the cores on PopOS X11 with NVIDIA: 560.35.03 560.35.3.0 driver. It does have a 100% CPU spike for a split second, but it is at the very beginning. This is a 13th gen i7-13700HX laptop CPU, 16GB RAM with 4060 8gb VRAM laptop GPU. (Lenovo Legion, somethingsomething, forgot the exact model name)