Skip to main content

A tool to monitor NVIDIA GPU usage across Docker containers

Project description

nvidia-docker-smi

A command-line tool to monitor NVIDIA GPU usage across Docker containers.

Installation

pip install nvidia-docker-smi

Usage

Simply run:

> nvidia-docker-smi

--- GPU Summary ---
GPU-0: Util: 0%, Mem: 6735M/11019M (Free: 4284M)
GPU-1: Util: 0%, Mem: 8M/11019M (Free: 11011M)
GPU-2: Util: 0%, Mem: 5938M/11019M (Free: 5081M)
GPU-3: Util: 0%, Mem: 8M/11019M (Free: 11011M)
-------------------

pid      user  proc             type  container             gpu_util  gpu_mem  cpu   mem   gpu
3405     root  Xorg             G     -                     0%        N/A      0.0%  0.0%  GPU-0
902386   root  python3          C     data_collector        0%        439M     0.2%  0.5%  GPU-0
2343459  root  api_server       C     api_server            0%        511M     0.1%  0.1%  GPU-0
2343966  root  python           C     ai_server             0%        5777M    1.9%  3.2%  GPU-0
3405     root  Xorg             G     -                     0%        N/A      0.0%  0.0%  GPU-1
3405     root  Xorg             G     -                     0%        N/A      0.0%  0.0%  GPU-2
1944839  root  api_server       C     api_server_caleb      0%        511M     0.0%  0.1%  GPU-2
1944937  root  python           C     ai_server_caleb       0%        5419M    0.1%  3.2%  GPU-2
3405     root  Xorg             G     -                     0%        N/A      0.0%  0.0%  GPU-3

Add --debug flag for performance profiling:

> nvidia-docker-smi --debug

...

--- Performance Profile ---
refresh_container_pid_map     :   0.0752s ( 18.4%)
get_gpu_memory_usage          :   0.0452s ( 11.1%)
get_gpu_stats                 :   0.0471s ( 11.6%)
get_ps_data                   :   0.1181s ( 29.0%)
get_container_map             :   0.0020s (  0.5%)
display_gpu_summary           :   0.0429s ( 10.5%)
prepare_data_rows             :   0.0737s ( 18.1%)
display_formatted_output      :   0.0036s (  0.9%)
Total execution time          :   0.4079s
---------------------------

Requirements

  • Python 3.6 or higher
  • NVIDIA GPU with installed drivers
  • Docker

5. Install the package locally for development:

cd nvidia_docker_smi
pip install -e .

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

nvidia_docker_smi-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nvidia_docker_smi-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nvidia_docker_smi-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.4

File hashes

Hashes for nvidia_docker_smi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 609f14c5771bea0703b996dc8f95ddb518d5fd47326eee1c10ef022ca9bfcf50
MD5 b18ac0febc6fb1f808317a599bd92472
BLAKE2b-256 6fa25921171ae9aacfd2917f671be0ce887a3b1a8922ed5a318c59857a90d6d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nvidia_docker_smi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2e1774a64a58dab0f8f9a806dcf1f3a832e2d29fc0fd086426f27308da354d2
MD5 bbfebaee4808e4fe6ceddb39e19c3b16
BLAKE2b-256 df78de65ed44d62ba2f947ece428c3eeebe1993a8f9038d0fd90645cf7617338

See more details on using hashes here.

Supported by

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