https://github.com/lampaa/nvidia-smi-rest
Nvidia smi rest api with docker
https://github.com/lampaa/nvidia-smi-rest
docker java nvidia-rest nvidia-smi
Last synced: 4 months ago
JSON representation
Nvidia smi rest api with docker
- Host: GitHub
- URL: https://github.com/lampaa/nvidia-smi-rest
- Owner: lampaa
- License: mit
- Created: 2020-11-05T17:07:10.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-15T15:13:13.000Z (almost 5 years ago)
- Last Synced: 2025-04-02T20:11:39.857Z (6 months ago)
- Topics: docker, java, nvidia-rest, nvidia-smi
- Language: Java
- Homepage:
- Size: 190 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
**What is it?**
Smi Rest - service for obtaining GPU data in a convenient format and collecting statistics.
**How to install?**
1. For Windows and Linux, needs to install the nvidia driver https://www.nvidia.com/Download/index.aspx
1. For use without containerization, install Java 11 https://adoptopenjdk.net/
1. For use with containerization, install docker, docker-compose https://docs.docker.com/get-docker/
1. To use in Docker, you need to install the NVIDIA Container Toolkit https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker**Without Docker**
* Package project `maven package`
* Or download release https://github.com/lampaa/nvidia-smi-rest/releases/latest
* Run `java -jar smirest-0.0.2.jar`**With Docker**
* Run `docker-compose -d up`
**REST API**
* http://localhost:8176/v1 - get all log from gpu devices
* http://localhost:8176/v1/GPU-UUID - get log from one gpu device
* http://localhost:8176/v1/GPU-a9685d8a-fbf2-7465-ee1f-307141ef06a8/pci/pciGpuLinkInfo/pcieGen - get field from log one gpu device
* http://localhost:8176/stats - get stats from all gpu devices
* http://localhost:8176/stats/GPU-UUID - get stats from one gpu device
* http://localhost:8176/stats/graphs - get stats graphics
**Maven dependency**
```xmlcom.github.lampaa
smirest
0.0.2```
**How to use**
```java
NvidiaSmiLogType smi = SmiReader.read(); // read from system
NvidiaSmiLogType smi = SmiReader.read(new File("smi_log.xml")); // read from xml file
NvidiaSmiLogType smi = SmiReader.read(new FileInputStream("smi_log.xml")); // read from input stream
NvidiaSmiLogType smi = SmiReader.read("..."); // from string
NvidiaSmiLogType smi = SmiReader.read(new StringReader("...")); // from reader
```**Documentation**
* Swagger http://lampaa.github.io/com.lampa.smirest/swagger/index.html
* JavaDoc http://lampaa.github.io/com.lampa.smirest/docs/index.html