A pythonic cross-platform module for getting the GPU info and status from NVIDA GPU boards.

Our member and doctoral student Antônio Carlos Júnior created a python library to access, in an easy and readable way, the GPU information from a python code.

This functionality aims to monitor whether or not the code is using the GPU, as well as the memory. This is useful for calculating the batch size (forward only) at run time.

This library is also enabled to list only the GPUs that the slurm allocates or all of the host’s GPUs.

Quick Start

Install the igpu module.

pip install igpu

And, enjoy it!

import igpu
gpu_count = igpu.count_devices()
gpu = igpu.get_device(0)
print(f'This host has {gpu_count} devices.')
print(f'The first gpu is a {gpu.name} with {gpu.memory.total:.0f}{gpu.memory.unit}.')
This host has 4 devices.
The first gpu is a GeForce GTX 1080 Ti with 11178.50 MiB

 

Access the link below for complete documentation

https://github.com/acnazarejr/igpu