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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file ngpuinfo-0.1.0.tar.gz.

File metadata

  • Download URL: ngpuinfo-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for ngpuinfo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b73ece85f701ec7303610072f9c046f9e341049170d9b6da1581224ef810ddbc
MD5 640bd43fef30ff23ee854ca3954920bf
BLAKE2b-256 19748807a0a65fa819c28d6948e224c389d5772d13c36ba7abb9c2cfa98abd87

See more details on using hashes here.

File details

Details for the file ngpuinfo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ngpuinfo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for ngpuinfo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fed18cddabc0a1181541bfaff3bf262718e9b5bbe50c409afbe80cc5b567b018
MD5 9f174234fc127800ebad9816582e28bd
BLAKE2b-256 fc0a7020965f5c9dc99ac2c32c8df9083a715b9614c3db40c640648e92fa13c0

See more details on using hashes here.

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