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

List available devices #466

Open
jakirkham opened this issue Jun 26, 2017 · 5 comments
Open

List available devices #466

jakirkham opened this issue Jun 26, 2017 · 5 comments

Comments

@jakirkham
Copy link

Would be really handy if there was a way to list all available devices on a machine. Not sure if this is possible or already exists (and I overlooked the docs 🤦‍♂️).

@abergeron
Copy link
Member

You can list the number of platforms with

pygpu.gpuarray.count_platforms(kind)

and the devices with

pygpu.gpuarray.count_devices(kind, platno)

Is this what you had in mind?

@jakirkham
Copy link
Author

Not exactly, but that does work. Thanks.

Would note that pygpu.gpuarray.count_platforms("cuda") returned 1 on a platform with no CUDA compatible GPUs. Can open a new issue to investigate further if there is interest.

@abergeron
Copy link
Member

The platform is there, but there should be no devices. It's a side effect of dynamically loading the libraries when required.

However, I don't claim that these functions are 100% bug-free, so if you find issues, please report them.

@lepeuvedic
Copy link

There is an issue with pygpu.gpuarray.count_platforms("cuda") returning 1 on platform without CUDA compatible GPUs : when the program tries to explore the devices on this inexistant platform, python tries to load libcuda.so dynamically, doesn't find if (of course) and raises an exception. A correct piece of software should not raise exceptions. In this case, calling count_devices('cuda',0) is a legitimate action when count_platforms('cuda') returns greater than zero.

@abergeron
Copy link
Member

That is something we could fix.

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

3 participants