class insights.parsers.nvidia.NvidiaGPUInfo(index, model, uuid, memory_total)

Bases: tuple

namedtuple: Represents the information parsed from nvidia-smi --query-gpu command output.

index
memory_total
model
uuid
class insights.parsers.nvidia.NvidiaSmiActiveClocksEventReasons(context)[source]

Bases: Parser, list

Parser for the output of command /usr/bin/nvidia-smi --query-gpu=name,clocks_event_reasons.active --format=csv,noheader. This command lists each of the NVIDIA GPUs in the system, along with their names and bitmasks of active clock event reasons.

Raises:
Sample Content::

NVIDIA L4, 0x0000000000000001 NVIDIA A1, 0x0000000000000000 NVIDIA H1, 0x0000000000000084

Examples::
>>> type(active_clocks_event_reasons)
<class 'insights.parsers.nvidia.NvidiaSmiActiveClocksEventReasons'>
>>> len(active_clocks_event_reasons)
3
>>> active_clocks_event_reasons[0]['applications_clocks_setting']
False
>>> active_clocks_event_reasons[2]['hw_power_brake_slowdown']
True
>>> active_clocks_event_reasons[2]['none']
False
parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.nvidia.NvidiaSmiL(context)[source]

Bases: Parser, list

Warning

This class is deprecated and will be removed from 3.8.0. Please use the insights.parsers.nvidia.NvidiaSmiQueryGPU instead.

Prase for output of command /usr/bin/nvidia-smi -L. This command lists each of the NVIDIA GPUs in the system, along with their UUIDs.

The GPU info shown in each line will be parsed as follows:

model (string):   The gpu model
uuid (string):    The gpu uuid
Raises:

Sample Content:

GPU 0: NVIDIA A100-PCIE-40GB (UUID: GPU-63110aaa-3561-c8f5-e125-4ab40bbcf838)
GPU 1: NVIDIA A100-PCIE-40GB (UUID: GPU-c9bd25dc-c0c4-3ab6-8f7f-3ad16d6bde4a)
Examples::
>>> gpus.gpu_count
2
>>> "NVIDIA A100-PCIE-40GB" in gpus.gpu_models
True
>>> gpus[0]
{'model': 'NVIDIA A100-PCIE-40GB', 'uuid': 'GPU-63110aaa-3561-c8f5-e125-4ab40bbcf838'}
property gpu_count

Returns the GPU count

Type:

str

property gpu_models

Returns the GPUs model set

Type:

str

parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.nvidia.NvidiaSmiQueryGPU(context)[source]

Bases: Parser, list

Parser for the output of command /usr/bin/nvidia-smi --query-gpu=index,name,uuid,memory.total --format=csv,noheader. This command lists each of the NVIDIA GPUs info in the system.

The GPU info shown in each line will be parsed to a namedtuple NvidiaGPUInfo contains the follows info:

index (str):        The gpu index
model (str):        The gpu model
uuid (str):         The gpu uuid
memory_total(str):  The gpu total memory
Raises:

Sample Content:

0, NVIDIA L4, GPU-24598a07-f97d-fc79-86de-485c4c82d01c, 23034 MiB
1, NVIDIA A1, GPU-63110aaa-3561-c8f5-e125-4ab40bbcf838, 16280 MiB
2, NVIDIA H1, GPU-c9bd25dc-c0c4-3ab6-8f7f-3ad16d6bde4a, 24564 MiB
Examples::
>>> gpus_info.gpu_count
3
>>> "NVIDIA L4" in gpus_info.gpu_models
True
>>> type(gpus_info[0])
<class 'insights.parsers.nvidia.NvidiaGPUInfo'>
>>> gpus_info[0].uuid
'GPU-24598a07-f97d-fc79-86de-485c4c82d01c'
>>> gpus_info[0].memory_total
'23034 MiB'
property gpu_count

Returns the GPU count

Type:

str

property gpu_models

Returns the GPUs model set

Type:

str

parse_content(content)[source]

This method must be implemented by classes based on this class.