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

How to get devices names? #223

Closed
iperov opened this issue Apr 22, 2021 · 2 comments
Closed

How to get devices names? #223

iperov opened this issue Apr 22, 2021 · 2 comments

Comments

@iperov
Copy link

iperov commented Apr 22, 2021

tf.config.experimental.get_visible_devices()
returns tf devices with /DML:0 names.
But how to get real device name such as 'Geforce ...' ?

@PatriceVignola
Copy link
Contributor

Hi,

You can do

from tensorflow.python.client import device_lib
device_lib.list_local_devices()

You will get the list of devices and their physical description and driver version as a json string. For example:

[name: "/device:DML:0"
device_type: "DML"
memory_limit: 7593787392
locality {
}
incarnation: 10390167996643278412
physical_device_desc: "{\"name\": \"NVIDIA GeForce RTX 2080 SUPER\", \"vendor_id\": 4318, \"device_id\": 7809, \"driver_version\": \"27.21.14.7025\"}"
]

@iperov
Copy link
Author

iperov commented Apr 22, 2021

thx

@iperov iperov closed this as completed Apr 22, 2021
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

2 participants