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

DRI_PRIME=1 is set unconditionally on linux when hardware adapter is used #328

Open
mukilan opened this issue Jan 2, 2025 · 1 comment

Comments

@mukilan
Copy link
Member

mukilan commented Jan 2, 2025

Originally reported in servo/servo#34814

The DRI_PRIME environment variable is being set by surfman unconditionally. This is the commit that introduced this feature.

According to the mesa documentation DRI_PRIME=1 will be interpreted as the number of the (non-default) GPU to use and not just as an 'enable low power mode' flag, but I don't know enough about this to say if surfman's usage of DRI_PRIME is a bug. It is also not clear to me if DRI_PRIME=1 is a bug if the system has only one gpu.

As seen in servo/servo#34814, this seems to break other applications (like some tinyfiledialog backends) in some cases. I

@mukilan
Copy link
Member Author

mukilan commented Jan 2, 2025

pub(crate) fn hardware() -> Adapter {
Adapter::HardwarePrime
}
#[inline]
pub(crate) fn low_power() -> Adapter {
Adapter::Hardware
}

It is also suspicious that it is hardware() that creates HardwarePrime adapter and not low_power() , which uses Hardware adapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant