Skip to main content

A simple package used for getting gpu information.

Project description

NGPUInfo

Install

pip install ngpuinfo

Description

This package uses nvidia-smi to get gpu information, so it only support nvidia gpus, and the nvidia-smi must be in system path.

Get start

from ngpuinfo import NGPUInfo

print(NGPUInfo.NUMBERS)
print(NGPUInfo.CUDA_VERSION)
gpus = NGPUInfo.list_gpus()
for g in gpus:
    print()
    print(g.id)
    print(g.name)
    print(g.mem_info())

Usage

gpu = NGPUInfo.list_gpus()[0]

gpu.mem_total() # total mem of gpu, realtime refresh, the unit is Byte
gpu.mem_used()  # used  mem of gpu, realtime refresh, the unit is Byte
gpu.mem_free()  # free  mem of gpu, realtime refresh, the unit is Byte

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ngpuinfo-0.1.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

ngpuinfo-0.1.0-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page