# Device info and device selection

**URL:** <https://community.memryx.com/t/device-info-and-device-selection/53>\
**Category:** Technical Support\
**Created:** [January 24, 2025, 8:11pm UTC](https://community.memryx.com/t/device-info-and-device-selection/53 "2025-01-24T20:11:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vlad-nn](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.memryx.com/vlad-nn/32/28_2.png) [@vlad-nn](https://community.memryx.com/u/vlad-nn)\
**Post date:** [January 24, 2025, 8:11pm UTC](https://community.memryx.com/t/device-info-and-device-selection/53/1 "2025-01-24T20:11:16Z")

</div>

It would be nice to provide API to query device info for all installed MX devices: at least how many devices are available.

Then, it would be nice to be able to do inference on a particular device, specifying the device to operate with in the API. As of now, there is no any notion in API about device selection.

---

<div class="post-metadata">

**Author:** ![mx-tim](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.memryx.com/mx-tim/32/62_2.png) [@mx-tim](https://community.memryx.com/u/mx-tim)\
**Post date:** [January 24, 2025, 10:30pm UTC](https://community.memryx.com/t/device-info-and-device-selection/53/2 "2025-01-24T22:30:40Z")

</div>

Hi,

When there’s multiple M.2s connected to a system, you can specify which to run on in a few ways:

- C++ API: give the device (“group”) index to the [connect\_dfp](https://developer.memryx.com/api/accelerator/cpp.html#_CPPv4N2MX7Runtime6MxAccl11connect_dfpEKNSt10filesystem4pathEi) function to use a single given M.2, or provide a vector of IDs to the same [connect\_dfp](https://developer.memryx.com/api/accelerator/cpp.html#_CPPv4N2MX7Runtime6MxAccl11connect_dfpEKNSt10filesystem4pathERNSt6vectorIiEE) function if you want to automatically distribute the same DFP across multiple M.2s
- Python API: give the device index to the [group\_id](https://developer.memryx.com/api/accelerator/python.html#accl.AsyncAccl) parameter of the constructor (no distributed DFP options yet)
- acclBench tool: list the device index(es) to the [–device\_ids](https://developer.memryx.com/tools/benchmark/acclbench.html) argument to benchmark on one or more M.2s

Let me know if you have any followup questions on this.

Thanks!

---

<div class="post-metadata">

**Author:** ![vlad-nn](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.memryx.com/vlad-nn/32/28_2.png) [@vlad-nn](https://community.memryx.com/u/vlad-nn)\
**Post date:** [January 24, 2025, 11:42pm UTC](https://community.memryx.com/t/device-info-and-device-selection/53/3 "2025-01-24T23:42:42Z")

</div>

Hi Tim!

Thanks for explanation. So let me confirm: group\_id parameter is actually a M.2 device index, right? If so, it would be nice to describe it in documentation clearly. As of now it say: “GroupId of MPU this application is intended to use. group\_id is defaulted to 0, but needs to be provided if using any other group”, which is not very clear.

And the next question is: how to obtain the list of available devices, or at least the number of available devices? I diligently searched your documentation as well as header files and cannot find any public API to query such info.

And one more question, the most important one: can I use two devices simultaneously but independently? I.e. run one model on the first device and simultaneously run another model on the second device?

---

<div class="post-metadata">

**Author:** ![vlad-nn](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.memryx.com/vlad-nn/32/28_2.png) [@vlad-nn](https://community.memryx.com/u/vlad-nn)\
**Post date:** [January 28, 2025, 11:07pm UTC](https://community.memryx.com/t/device-info-and-device-selection/53/4 "2025-01-28T23:07:19Z")

</div>

Hi Tim!  
Any comments on my last set of questions?

---

<div class="post-metadata">

**Author:** ![mx-tim](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.memryx.com/mx-tim/32/62_2.png) [@mx-tim](https://community.memryx.com/u/mx-tim)\
**Post date:** [January 28, 2025, 11:13pm UTC](https://community.memryx.com/t/device-info-and-device-selection/53/5 "2025-01-28T23:13:32Z")

</div>

Hi Vlad,

Yep, group\_id is really more like “device\_id” and we’ll be sure to clarify the API text. Thanks for finding this issue.

On the command line, the number of devices in the system can currently be found by counting the /sys/memx\* entries. But the C++ API has a private function to print the found devices: `MX::Runtime::DeviceManager.print_available_devices()`, which is probably much preferred, so we’ll be sure to wrap it up to a public function in the top level MxAccl object in the next release.

Lastly, regarding independent devices: yes! You can either have 2 MxAccl (or AsyncAccl in Python) objects in one process, one with group\_id 0 and the other with id 1. They can be used independently with different DFPs. Alternatively, you could have separate processes/applications, one that uses group\_id 0 for its MxAccl object, and the other that uses id 1.

---

<div class="post-metadata">

**Author:** ![vlad-nn](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.memryx.com/vlad-nn/32/28_2.png) [@vlad-nn](https://community.memryx.com/u/vlad-nn)\
**Post date:** [January 29, 2025, 12:59am UTC](https://community.memryx.com/t/device-info-and-device-selection/53/6 "2025-01-29T00:59:59Z")

</div>

Thanks! That’s great news!
