A Java wrapper for the NVIDIA Management Library.
Maven (pom.xml)
<dependency>
<groupId>de.bommel24.nvmlj</groupId>
<artifactId>nvmlj</artifactId>
<version>1.0.2</version>
</dependency>
<repository>
<id>henkelmax.public</id>
<url>https://maven.maxhenkel.de/repository/public</url>
</repository>
// The path to the nvml library (Defaults to C:/Program Files/NVIDIA Corporation/NVSMI/nvml.dll)
System.setProperty("nvml.path", "path/to/your/nvml.dll");
NVMLJ.nvmlInit();
System.out.println(NVMLJ.nvmlDeviceGetCount());
NVMLJ.nvmlShutdown();