Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running template on WSL2 #12

Open
TobiasEppacher opened this issue Nov 3, 2024 · 5 comments
Open

Error when running template on WSL2 #12

TobiasEppacher opened this issue Nov 3, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@TobiasEppacher
Copy link

TobiasEppacher commented Nov 3, 2024

While using the template on WSL2 (Windows 11), the building of the project went through fine.
The problem occurred when executing the program:

thread '<unnamed>' panicked at 'Error in wgpuDeviceCreateSwapChain: Validation Error

Caused by:
    Invalid surface
', src/lib.rs:495:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
[1]    26160 IOT instruction (core dumped)  /home/tobias/game-physics-template/build/Template

I suspect WSL2 to be responsible for the error, as after installing the C++ Workload with Visual Studio, the executing on my native Windows system worked.

System Info, if required:

  • WSL2 (Ubuntu 22.04.4 LTS) on Windows 11 Pro (23H2)
  • Processor: Intel Core i5-12600
  • GPU: NVIDIA GeForce RTX 3060 (Driver 560.94 | I will try again after updating)
@Ceyron Ceyron added the bug Something isn't working label Nov 4, 2024
@wi-re
Copy link
Collaborator

wi-re commented Nov 4, 2024

Thank you for opening this issue, I am currently facing the same problem on my machine and this issue is not just limited to our template. There is a very good WebGPU tutorial (https://github.com/eliemichel/LearnWebGPU-Code/tree/step025) using C++ that is also broken currently, even though both used to work before.

System:

  • WSL2 (Ubuntu 20.04 LTS) on Windows 11 (23H2)
  • Processor: AMD 3950x
  • GPU: Nvidia 3090 (Driver 566.03)

Could you @TobiasEppacher also post your driver version?

@wi-re
Copy link
Collaborator

wi-re commented Nov 5, 2024

@TobiasEppacher could you try the DemoProject branch and see if that fixes it? For me the issue seemed to come from how X11 interacts on WSL with the display.

Instead of trying some obscure solution like xming, the easier solution was to use Wayland as the window manager. Using wayland allows me to at least launch and interact with the template, even though it won't show window decorations (close button, top bar etc) on some Ubuntu versions, e.g. 22.04 for me, due to there being no libdecor-0-dev package.

@TobiasEppacher
Copy link
Author

@TobiasEppacher could you try the DemoProject branch and see if that fixes it? For me the issue seemed to come from how X11 interacts on WSL with the display.

Instead of trying some obscure solution like xming, the easier solution was to use Wayland as the window manager. Using wayland allows me to at least launch and interact with the template, even though it won't show window decorations (close button, top bar etc) on some Ubuntu versions, e.g. 22.04 for me, due to there being no libdecor-0-dev package.

The build and execution worked with the changes on the DemoProject branch. If this change was merged to the main, I would suggest that similarily to the other required packages, a hint to libwayland-dev should be included.

Other than that, I only noticed that the program crashes again, if the FPS limiter is turned off. But since this is not vital to the functionality of the template I think this is a minor drawback of using WSL.

@wi-re
Copy link
Collaborator

wi-re commented Nov 7, 2024

Thank you for rechecking this. The FPS limiter is something that is not working on Wayland in the way we originally implemented this (see Issue #17). The fix-wayland branch has a solution to this problem, which basically involves disabling the FPS limiter on Wayland in most configurations.

Our current idea is to keep a separate experimental branch (with more up-to-date third-party packages and potentially breaking changes). We would then add a setup document in the main branch (see #15) that refers people to this branch and how to set it up if they have issues or are using a system configuration that is not supported by the current main branch.

Would this work for you?

@TobiasEppacher
Copy link
Author

As of current, I already settled for the Windows native environment. Therefore I made my suggestion mainly with future users in mind, rather than myself.
The setup document seems a nice approach to help new users with the WSL setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants