This API takes in a tf.config.PhysicalDevice returned by
tf.config.list_physical_devices. It returns a dict with string keys
containing various details about the device. Each key is only supported by a
subset of devices, so you should not assume the returned dict will have any
particular key.
Currently, details are only returned for GPUs. This function returns an
empty dict if passed a non-GPU device.
The returned dict may have the following keys:
'device_name': A human-readable name of the device as a string, e.g.
"Titan V". Unlike tf.config.PhysicalDevice.name, this will be the same for
multiple devices if each device is the same model. Currently only available
for GPUs.
'compute_capability': The
compute capability of the device
as a tuple of two ints, in the form (major_version, minor_version). Only
available for NVIDIA GPUs
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.config.experimental.get_device_details\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/framework/config.py#L757-L799) |\n\nReturns details about a physical devices.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.config.experimental.get_device_details`](https://www.tensorflow.org/api_docs/python/tf/config/experimental/get_device_details)\n\n\u003cbr /\u003e\n\n tf.config.experimental.get_device_details(\n device\n )\n\nThis API takes in a [`tf.config.PhysicalDevice`](../../../tf/config/PhysicalDevice) returned by\n[`tf.config.list_physical_devices`](../../../tf/config/list_physical_devices). It returns a dict with string keys\ncontaining various details about the device. Each key is only supported by a\nsubset of devices, so you should not assume the returned dict will have any\nparticular key. \n\n gpu_devices = tf.config.list_physical_devices('GPU')\n if gpu_devices:\n details = tf.config.experimental.get_device_details(gpu_devices[0])\n details.get('device_name', 'Unknown GPU')\n\nCurrently, details are only returned for GPUs. This function returns an\nempty dict if passed a non-GPU device.\n\nThe returned dict may have the following keys:\n\n- `'device_name'`: A human-readable name of the device as a string, e.g. \"Titan V\". Unlike [`tf.config.PhysicalDevice.name`](../../../tf/config/PhysicalDevice#name), this will be the same for multiple devices if each device is the same model. Currently only available for GPUs.\n- `'compute_capability'`: The [compute capability](https://developer.nvidia.com/cuda-gpus) of the device as a tuple of two ints, in the form `(major_version, minor_version)`. Only available for NVIDIA GPUs\n\n| **Note:** This is similar to [`tf.sysconfig.get_build_info`](../../../tf/sysconfig/get_build_info) in that both functions can return information relating to GPUs. However, this function returns run-time information about a specific device (such as a GPU's compute capability), while [`tf.sysconfig.get_build_info`](../../../tf/sysconfig/get_build_info) returns compile-time information about how TensorFlow was built (such as what version of CUDA TensorFlow was built for).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `device` | A [`tf.config.PhysicalDevice`](../../../tf/config/PhysicalDevice) returned by [`tf.config.list_physical_devices`](../../../tf/config/list_physical_devices) or [`tf.config.get_visible_devices`](../../../tf/config/get_visible_devices). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A dict with string keys. ||\n\n\u003cbr /\u003e"]]