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

Allow controlling the graphics backend & power preference through standard wgpu env vars #1332

Merged
merged 3 commits into from Feb 16, 2023

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Feb 16, 2023

Didn't realize that these env-vars are opt-ins from wgpu::util (kinda makes sense thinking about it!)
This might help us with troubleshooting in tickets like #1324

Depicted is my Ubuntu vm running with GL - note how this completely meses up gamma handling -.-
image

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I've added a line to CHANGELOG.md (if this is a big enough change to warrant it)

@Wumpf Wumpf added enhancement New feature or request 🔺 re_renderer affects re_renderer itself labels Feb 16, 2023
@Wumpf Wumpf merged commit 6c2b291 into main Feb 16, 2023
@Wumpf Wumpf deleted the andreas/enable-gl-fallback-on-linux branch February 16, 2023 16:52
// * Some Windows VMs only provide DX12 drivers, observed with Parallels on Apple Silicon
// * May run into Linux issues that warrant trying out the GL backend.
//
// For changing the backend we use standard wgpu env var, i.e. WGPU_BACKEND.
Copy link
Member

@emilk emilk Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wgpu docs are quite lacking here in what WGPU_BACKEND expects, but reading the code it seems like it would be:

WGPU_BACKEND=gl,metal ?

Please add a comment here so that the next reader can just use the env-var instead of having to dig into the wgpu code!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh. yes I'll sneak that in some future PR. Also I'll create a PR for our troubleshooting doc page.

For everyone stumbling in here. This makes us support:

WGPU_BACKEND with a comma separated list of the backends you want to use: vulkan, metal, dx12, dx11, or gl).

WGPU_POWER_PREF with the power preference to choose when a specific adapter name isn't specified - high or low

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces two new environment variables that control the behavior of Rerun:

WGPU_BACKEND and WGPU_POWER_PREF.

We should document them!

It would make sense to me if rerun --help would list them, and that's indeed where RERUN_TRACK_ALLOCATIONS is already documented (in crates/rerun/src/run.rs). Please add the above environment variables to that list, and maybe throw in RERUN while your at it, since we seems to have forgotten that one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🔺 re_renderer affects re_renderer itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants