Skip to main content

Tracks computational resources of a process and its child processes, most prominently GPU RAM, as well as RAM, compute time, and CPU utilization.

Project description

Description

The gpu_tracker package provides a Tracker class and a commandline-interface that tracks (profiles) the usage of compute time, CPU utilization, maximum RAM, GPU utilization, and maximum GPU RAM. The compute time is a measurement of the real time taken by the task as opposed to the CPU-utilization time. The GPU tracking is for both Nvidia and AMD GPUs and respectively uses the nvidia-smi and amd-smi command-line tools to pull GPU usage information. Also, if neither the appropriate Nvidia nor AMD driver is installed, then the GPU-related metrics are not tracked and are reported as 0. Computational resources are tracked throughout the duration of a context manager or the duration of explicit calls to the start() and stop() methods of the Tracker class. The gpu-tracker command-line interface alternatively tracks the computational-resource-usage of an arbitrary shell command.

NOTE: The tracking occurs in a separate process. To maximize the accuracy of the reported resource usage, you may want to have a core available solely for the tracking process e.g. if your job uses 3 workers, you may want to allocate 4 cores.

NOTE: Since the tracking process is created using the Python multiprocessing library, if done so using the “spawn” start method (default on MacOS and Windows) or the “forkserver” method, you may get a runtime error after starting the tracking. To prevent this, you’ll need to start the tracker after checking if __name__ == '__main__'. See “Safe importing of main module” under The spawn and forkserver start methods for more information.

Documentation

The complete documentation for the gpu_tracker package, including tutorials, can be found here.

Installation

Requires python 3.10 and above.

Install on Linux, Mac OS X

python3 -m pip install gpu-tracker

Install on Windows

py -3 -m pip install gpu-tracker

PyPi

See our PyPi page here.

Questions, Feature Requests, and Bug Reports

Please submit any questions or feature requests you may have and report any potential bugs/errors you observe on our GitHub issues page.

GitHub Repository

Code is available on GitHub: https://github.com/MoseleyBioinformaticsLab/gpu_tracker.

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

gpu_tracker-5.0.1.tar.gz (118.8 kB view details)

Uploaded Source

Built Distribution

gpu_tracker-5.0.1-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file gpu_tracker-5.0.1.tar.gz.

File metadata

  • Download URL: gpu_tracker-5.0.1.tar.gz
  • Upload date:
  • Size: 118.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gpu_tracker-5.0.1.tar.gz
Algorithm Hash digest
SHA256 b15ebed2e439f44bd19f2ea1c40f11fb4253d3fc2edec68a0f3049e203e17fa4
MD5 cec521f51d6a618ea7a0c4f74c032831
BLAKE2b-256 35abe038e6eeb3b2efcb099b4bd51e3cdde3e529bf4001ac8aa79f5ead1d2ae4

See more details on using hashes here.

File details

Details for the file gpu_tracker-5.0.1-py3-none-any.whl.

File metadata

  • Download URL: gpu_tracker-5.0.1-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gpu_tracker-5.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fbb56110433687640eb3289a1f32fa2b3ad78a77d83f2eca0ab3e5e1b026abac
MD5 62b64b1e5ad09419f2464e62d5f465f0
BLAKE2b-256 919ee897f040b68480c58b458b432d071c378bcc0b8afb4de37c34f352d792ec

See more details on using hashes here.

Supported by

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