Code Monkey home page Code Monkey logo

gmon's Introduction

gmon: GPU Memory Monitoring Tool

gmon is a lightweight, easy-to-use Python tool designed for monitoring GPU memory usage in real-time. It is particularly useful in optimizing and debugging machine learning and data processing applications, tracking peak GPU memory usage, and now features an HTML report for a detailed memory usage graph.

Installation

To install gmon, use pip to install directly from the GitHub repository:

pip install git+https://github.com/adamlouly/gmon.git

Ensure nvidia-smi is installed on your system, as gmon relies on it to fetch GPU memory usage data.

Usage

To monitor GPU memory usage of your script with gmon, prefix your command like this:

gmon python your_script.py

Replace your_script.py with the path to the Python script you want to monitor. gmon will execute your script, displaying peak GPU memory usage upon completion, and generate an HTML report if enabled.

Enabling HTML Report

To enable the HTML report feature, set the environment variable GMON_TRACE to 1. Here's how you can do it on different operating systems:

  • Linux:
    export GMON_TRACE=1
    gmon python your_script.py
  • Windows (Command Prompt):
    set GMON_TRACE=1
    gmon python your_script.py

The HTML report (gmon_gpu_memory_usage.html) will be generated in the current working directory, providing a visual representation of GPU memory usage over time.

Features

  • Real-time Monitoring: Tracks GPU memory usage continuously during script runtime.
  • Peak Memory Reporting: Reports peak memory usage across all GPUs.
  • HTML Report Generation: Generates a detailed graph of GPU memory usage over time.
  • Easy Integration: Seamlessly works with any Python script without script modifications.

Requirements

  • NVIDIA GPU with NVIDIA drivers installed.
  • nvidia-smi command-line tool.

License

gmon is open-sourced under the MIT License. See the LICENSE file for more details.


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.