I know that are many questions regarding of getting OS level information, I came through almost all of them, but I did not find something related to the gpu. I used System.getProperties, Runtime class and System.getenv. Thank you! Edited: I search for a windows solution
Asked
Active
Viewed 382 times
1
-
https://stackoverflow.com/a/26305209/2970947 – Elliott Frisch May 21 '19 at 06:10
-
Possible duplicate of [JavaFX: Tested/confirmed hardware (GPU) acceleration on Linux](https://stackoverflow.com/questions/26159317/javafx-tested-confirmed-hardware-gpu-acceleration-on-linux) – Onkar Musale May 21 '19 at 06:13
-
I am sorry, I did not mention that I search for a windows solution – Bogdan May 21 '19 at 06:28
-
https://stackoverflow.com/questions/25552/get-os-level-system-information – Ramachandra Reddy May 21 '19 at 06:33
-
@Ramachandra Reddy I did not find something about gpu there. – Bogdan May 21 '19 at 06:47
1 Answers
2
Try below code :
String line;
Process p = Runtime.getRuntime().exec("wmic PATH Win32_videocontroller GET description");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
}
input.close();
Output on my computer:
Description
Intel(R) HD Graphics 520
Windows commands are
wmic PATH Win32_videocontroller GET description
wmic PATH Win32_videocontroller GET adapterram
wmic PATH Win32_videocontroller GET driverversion
wmic PATH Win32_videocontroller GET pnpdeviceid

Shashwat
- 2,342
- 1
- 17
- 33