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

fix supports_device() in python interface #22473

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Oct 17, 2024

Description

get_device() returns a string of hyphen connected device names, such as "GPU-DML". It's a problem that when CUDA is disabled but OpenVino GPU is enabled in the build, because in this case get_device() returns "CPU-OPENVINO_GPU", so supports_device("CUDA") will return True in this build.

Splitting the value of get_device() by "-" and check if the input is in the list is not an option because it seems some code in the code base stores the value of get_device() and use the value to call supports_device(). Using this implementation will cause supports_device("GPU-DML") to return False for a build with get_device() == "GPU-DML" because "GPU-DML" in ["GPU", "DML"] is False.

This change also helps to avoid further problems when "WebGPU" is introduced.

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.

1 participant