glearn.device.get_gpu_name#

glearn.device.get_gpu_name()#

Gets the model name of GPU device.

Returns:
cpu_namestr

GPU model name. If no GPU device is found, it returns "not found".

Notes

This function parses the output of nvidia-smi command as

nvidia-smi -a | grep -i "Product Name" -m 1 | grep -o ":.*" |cut -c 3-

The nvidia-smi command is part of NVIDIA graphic driver. See Install NVIDIA Graphic Driver for further details. If a graphic driver is not installed, this function returns "not found".

Examples

>>> from glearn.device import get_gpu_name
>>> get_gpu_name()
'GeForce GTX 1080 Ti'