Skip to content

List available devices #466

Open
Open

Description

@jakirkham

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 🤦‍♂️).

Activity

  1. abergeron commented on Jun 26, 2017

    @abergeron
    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?

  2. jakirkham commented on Jun 26, 2017

    @jakirkham
    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.

  3. abergeron commented on Jun 26, 2017

    @abergeron
    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.

  4. lepeuvedic commented on Sep 7, 2017

    @lepeuvedic

    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.

  5. abergeron commented on Sep 11, 2017

    @abergeron
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions