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

Expose device_information #143

Merged
merged 5 commits into from
Jul 23, 2024
Merged

Expose device_information #143

merged 5 commits into from
Jul 23, 2024

Conversation

ConradIrwin
Copy link
Contributor

We'd like to be able to tell users not to use a software renderer, and to provide more information in the case of failures.

Fixes: #142

I have not yet implemented this on metal, but can do so if this approach seems sound to you.

We'd like to be able to tell users not to use a software renderer,
and to provide more information in the case of failures.

Fixes: kvark#142
Copy link
Owner

@kvark kvark left a comment

Choose a reason for hiding this comment

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

Generally speaking, exposing some information about the device is good and helpful.

However, I would very much like to squeeze this information to a form that is useful, as opposed to blindly exposing everything that Vulkan gives us. For example, Vulkan drivers aren't even in agreement about what is considered an integrated GPU and what not. This line is being blurred, and it's not really actionable by the user anyway.

What the user does need to know is if the adapter is emulated in software. That is definitely a strong distinction, where the line isn't blurred. So, we would ideally expose something like this:

struct DeviceInformation {
  name: String,
  is_software_emulated: bool,
}

@ConradIrwin
Copy link
Contributor Author

@kvark 👍 can make that change.

I had a few people on the linux channel suggest it would be useful to return the driver info too to help people debug what's happening. Is that information obtainable a different way, or should I keep returning that?

@ConradIrwin
Copy link
Contributor Author

@kvark updated to just return a bool. Kept all three strings, but can simplify if you'd prefer

Copy link
Owner

@kvark kvark left a comment

Choose a reason for hiding this comment

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

Sorry, one last thing

@@ -465,6 +465,10 @@ impl Context {
}
}

pub fn device_information(&self) -> &crate::DeviceInformation {
todo!();
Copy link
Owner

Choose a reason for hiding this comment

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

Can we return a default implementation instead? Crashing isn't fun for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@ConradIrwin
Copy link
Contributor Author

@kvark I'm keen to ship a new build to zed preview on Wednesday. I can pull this in, but is #144 something you feel comfortable with too?

@kvark kvark merged commit 7e497c5 into kvark:main Jul 23, 2024
5 checks passed
@kvark
Copy link
Owner

kvark commented Jul 23, 2024

@ConradIrwin I don't want to merge #144 until we confirm that it helps people.

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

Successfully merging this pull request may close these issues.

Allow querying the name and driver info of the chosen adapter
2 participants