Giter Club home page Giter Club logo

nkiraly / nvidiagpubeat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ebay/nvidiagpubeat

0.0 2.0 0.0 590 KB

nvidiagpubeat is an elastic beat that uses NVIDIA System Management Interface (nvidia-smi) to monitor NVIDIA GPU devices and can ingest metrics into Elastic search cluster. nvidia-smi is a command line utility, based on top of the NVIDIA Management Library (NVML), intended to aid in the management and monitoring of NVIDIA GPU devices.

Home Page: https://github.com/eBay/nvidiagpubeat

License: Apache License 2.0

Makefile 5.39% Go 85.23% Python 9.38%

nvidiagpubeat's Introduction

nvidiagpubeat

Welcome to nvidiagpubeat. nvidiagpubeat is an elastic beat that uses NVIDIA System Management Interface (nvidia-smi - https://developer.nvidia.com/nvidia-system-management-interface) to monitor NVIDIA GPU devices and can ingest metrics into Elastic search cluster. nvidia-smi is a command line utility, based on top of the NVIDIA Management Library (NVML), intended to aid in the management and monitoring of NVIDIA GPU devices.

nvidiagpubeat is built using Beats framework described at https://www.elastic.co/guide/en/beats/devguide/current/new-beat.html.

nvidiagpubeat elastic beat with help of nvidia-smi allows administrators to query GPU device state. It is targeted at the TeslaTM, GRIDTM, QuadroTM and Titan X product, though limited support is also available on other NVIDIA GPUs.

NVIDIA-smi ships with NVIDIA GPU display drivers on Linux, and with 64bit Windows Server 2008 R2 and Windows 7.

nvidiagpubeat provides ability (look at nvidiagpubeat.yml) to configure metrics that needs to be monitored and by default it queries utilization.gpu,utilization.memory,memory.total,memory.free,memory.used,temperature.gpu,pstate and can ingest them into elastic search cluster for possibly visualization using Kibana.

Getting Started with nvidiagpubeat

Build on macOS

Prerequisites

sudo curl https://bootstrap.pypa.io/get-pip.py | sudo python
sudo pip install virtualenv
brew install glide

Build on RedHat EL7

Prerequisites

yum install python-virtualenv
yum install golang

Initialize Project

Once the prerequisites have been installed, rest of the steps are common across OSes as nvidiagpubeat is written in Golang.

#Start with an empty directory
mkdir beats_dev

#Build with elastic beats branch=6.5 (Master branch might not always upto-date).
export WORKSPACE=`pwd`/beats_dev
export GOPATH=$WORKSPACE
git clone https://github.com/elastic/beats ${GOPATH}/src/github.com/elastic/beats --branch 6.5

#Clone nvidiagpubeat
mkdir $WORKSPACE/src/github.com/ebay
cd $WORKSPACE/src/github.com/ebay
git clone [email protected]:eBay/nvidiagpubeat.git

#Build
cd $WORKSPACE/src/github.com/ebay/nvidiagpubeat/
make setup
make

Above instructions will generate a binary in the same directory with the name nvidiagpubeat.

Run in production environment

To run nvidiagpubeat with pre-installed nvidia-smi that is available in PATH, switch to "test" environment in nvidiagpubeat.yml and use

env: "production"
export PATH=$PATH:.
./nvidiagpubeat -c nvidiagpubeat.yml -e -d "*" -E seccomp.enabled=false

seccomp.enabled setting : nvidiagpubeat uses libbeat framework. For security purposes the libbeat framework by default drops the ability to fork/exec. As nvidiagpubeat executes nvidia-smi, security setting must be disabled by setting through command line.

Run in test environment (macOS)

To run nvidiagpubeat with pre-packaged localnvidiasmi switch to "test" environment in nvidiagpubeat.yml and use

env: "test"
export PATH=$PATH:.
./nvidiagpubeat -c nvidiagpubeat.yml -e -d "*" -E seccomp.enabled=false

localnvidiasmi executable built for macOS and is a mock GPU event generator.

Sample event

Below is a sample event emitted by nvidiagpubeat.

Publish event: {
  "@timestamp": "2019-03-25T15:34:17.739Z",
  "@metadata": {
    "beat": "nvidiagpubeat",
    "type": "doc",
    "version": "6.5.5"
  },
  "utilization": {
    "gpu": 4,
    "memory": 40
  },
  "memory": {
    "used": 0,
    "total": 6082,
    "free": 6082
  },
  "temperature": {
    "gpu": 27
  },
  "pstate": 8,
  "beat": {
    "name": "hostname.company.com",
    "hostname": "hostname.company.com",
    "version": "6.5.5"
  },
  "host": {
    "name": "hostname.company.com"
  },
  "gpuIndex": 3,
  "type": "nvidiagpubeat"
}

Build

Make changes (if any) and build the binary for nvidiagpubeat run the command below. This will generate a binary in the same directory with the name nvidiagpubeat.

make

Test cases

To test nvidiagpubeat, run the following command:

make unit-tests
make integration-tests
make coverage-report

The test coverage is reported in the folder ./build/coverage/

Cleanup dependencies

To remove them dependent libraries, builds, temporary files, files created during tests and the executatble, simply run

 rm -rf build/
 rm -rf data/
 rm -rf nvidiagpubeat
 rm -rf nvidiagpubeat.test
 rm -rf vendor

Clone

To clone nvidiagpubeat from the git repository, run the following commands:

mkdir -p ${GOPATH}/github.com/ebay
cd ${GOPATH}/github.com/ebay
git clone [email protected]:eBay/nvidiagpubeat.git
cd nvidiagpubeat
git remote add upstream [email protected]:eBay/nvidiagpubeat.git

For further development, check out the beat developer guide.

Testimonials

I would love to hear about your use case. It will help me improve nvidiagpubeat. Please add few lines about your use case, affiliation and location. All fields are optional.

  1. Use Case: I am running deeplearning models on a headless linux machine. Therefore, it is essential for me to track my gpu load and related stats.

    Country: Germany

    Full Name: Julius Zimmermann

    Affiliation: Student

  2. Use Case:

    Country:

    Full Name:

    Affiliation:

  3. Use Case:

    Country:

    Full Name:

    Affiliation:

License

Copyright 2016-2018 eBay Inc. Architect/Developer: Deepak Vasthimal

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

nvidiagpubeat's People

Contributors

deepujain avatar minduni avatar ml-jzimmermann avatar

Watchers

 avatar  avatar

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.