-
-
Notifications
You must be signed in to change notification settings - Fork 50
Provide more control to select a specific GPU #481
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
Conversation
|
@Korijn @kushalkolar thoughts about the current API? The idea is that in pygfx there will be a Fastplotlib can provide a similar function that calls into the pygfx one. |
Sounds good to me! |
No objections here. |
|
I actually feel a bit uncomfortable with the current state of this pr, because the gpu selection is very fuzzy and arguably arbitrary, while everything else in wgpu-py is very well-defined. I want to propose a slightly different approach:
|
|
I created #482 to dive a bit deeper into what info we can extract from the adapter_info. |
Watching from afar, as I originated the enumerate_adapters PR in wgpu-native... I agree this is a good approach - just expose enumerate_adapters as a Python call and leave the selection to callers to do their own evaluation. This is a great alternative to using the standard "webgpu selection rules" to auto-select. |
|
Ok, I reduced this PR to only adding |
Considerations
The idea is to allow users to specify a specific GPU, which is particularly useful in a multi-GPU setup. The tricky bits are that the kinds of GPU's differ widely between systems, and there's a human choice in the loop. You don't want to prompt the user for input each time a script is run. Instead you want a simple way to present the user with the options on the current system, and do this once. Then in subsequent runs allow the user to specify one of these options using a string.
This PR simply makes it easier to enumerate adapters and get a description of each. The user is responsible for the selection mechanism, because this is always fuzzy, and we don't know the best approach yet, see #482. When we do, we will add a builtin selection mechanism to either pygfx or wgpu.utils.
Tasks
gpu.enumerate_adapters().adapter.summary, which is a single-line string that describes the adapter.