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

Should fall back to gl on native when vulkan fails #5968

Closed
jleibs opened this issue Apr 12, 2024 · 5 comments · Fixed by #6582
Closed

Should fall back to gl on native when vulkan fails #5968

jleibs opened this issue Apr 12, 2024 · 5 comments · Fixed by #6582
Assignees
Labels
🪳 bug Something isn't working 🔺 re_renderer affects re_renderer itself
Milestone

Comments

@jleibs
Copy link
Member

jleibs commented Apr 12, 2024

Linux environments, in particular inside of Docker frequently have issues with vulkan, but the gl backend works much more frequently.

Currently we get a cryptic crash:
image

Would be nice to instead fall back to gl.

@jleibs jleibs added 🪳 bug Something isn't working 🔺 re_renderer affects re_renderer itself labels Apr 12, 2024
@Wumpf
Copy link
Member

Wumpf commented Apr 13, 2024

Somewhat familiar with this crash. I fixed it for the upcoming wgpu version (can't be backported since there's an api breakage). That fix will allow us to react to this situation which boils down to "for unclear reasons any kind of surface creation fails". Would be nice to sit together and figure out where this comes from so we can fix it in wgpu - lots of people are hitting similar stuff.

@Wumpf Wumpf added this to the Triage milestone Apr 13, 2024
@Wumpf
Copy link
Member

Wumpf commented Apr 14, 2024

Looked a bit into this, this is a bigger wgpu issue that needs tackling. Some initial thoughts jotted down here
https://matrix.to/#/!FZyQrssSlHEZqrYcOb:matrix.org/$n522jAS-_Xtx_t21HuYvhT50XvxMqOn3X04LLAuuy6o

@Wumpf Wumpf self-assigned this Apr 30, 2024
@Wumpf
Copy link
Member

Wumpf commented Apr 30, 2024

I got a (very likely) fix for this into wgpu by now and it landed with 0.20. We have to upgrade our stack now and then retry

@Wumpf
Copy link
Member

Wumpf commented May 30, 2024

It looks like @02alexander has a good repro for this consistently by disabling Vulkan on his machine. On the 0.20 update branch we no longer get a crash but a more gentle shutdown. Curiously, wgpu-info reports a GL adapter, but we apparently don't pick it since it's not compatible for some reason
adapter.txt

Error on 0.20 branch as of writing:
error.txt

Two things to do here:

  • figure out why the GL adapter is not usable
    • print the whys
    • can we fix it?
  • catch the no-adapter case better and report something human readable

@Wumpf
Copy link
Member

Wumpf commented May 30, 2024

oh, it looks like we're only allowing GL when it's picked explicitly, I believed this was done automatically:
https://github.com/rerun-io/rerun/blob/main/crates/re_renderer/src/config.rs#L235

That would explain the previously described behavior perfectly well. We still should be able to handle the no-adapter-at-all case better though!

@emilk emilk modified the milestones: Triage, 0.17 May 30, 2024
Wumpf added a commit that referenced this issue Jun 14, 2024
### What

* Part of #6170
* Based on emilk/egui#4433
* Makes it possible to handle
#5968
* it no longer is a crash but an _okish_ error message (more to do
still)
 * Fixes #5283
    * [x] @jleibs can you confirm?


Test on:
* Mac
    * [x] native
    * [x] Firefox WebGL
    * [x] Chrome WebGPU
    * [x] Chrome WebGL 
* Windows
    * [x] native
    * [x] Firefox WebGL
    * [x] Chrome WebGPU
    * [x] Chrome WebGL 
* Linux
    * [x] native
    * [x] Firefox WebGL
    * [x] Chrome WebGPU
* needs both chrome://flags/#enable-unsafe-webgpu &
chrome://flags/#enable-vulkan flags set (via
https://developer.chrome.com/docs/web-platform/webgpu/troubleshooting-tips)
    * [x] Chrome WebGL 

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6171?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6171?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6171)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Wumpf added a commit that referenced this issue Jun 17, 2024
…ng together with `WGPU_BACKEND` env-var (#6582)

### What

Previously, we made the GL backend explicit opt-in (and accidentally
only via the wgpu env var, not solely via commandline). But I don't see
any reason for this as wgpu will (well, should) always prefer Vulkan
when available.

* Fixes [#5968](#5968)
* Reportedly there's still sometimes issues with he GL backend, but this
is captured now in #6581

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6582?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6582?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6582)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 🔺 re_renderer affects re_renderer itself
Projects
None yet
3 participants