T
T
timonestudio2021-11-20 15:35:51
Java
timonestudio, 2021-11-20 15:35:51

How to check JAVA video memory data?

I need to compare Dedicated Memory in code with ETH variable, how can I do it?

package brainsoft.miner;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class check {
  
  private int ETH = 5120;
  
  public static void main(String[] args) {        
      try {

          String filePath = "./brainminer.bm";
          // Use "dxdiag /t" variant to redirect output to a given file
          ProcessBuilder pb = new ProcessBuilder("cmd.exe","/c","dxdiag","/t",filePath);
          System.out.println("-- GPU INFO --");
          Process p = pb.start();
          p.waitFor();

          BufferedReader br = new BufferedReader(new FileReader(filePath));
          String line;
          System.out.println(String.format("-- Получение данных из %1$1s --",filePath));
          while((line = br.readLine()) != null){
              if(line.trim().startsWith("Card name:") || line.trim().startsWith("Dedicated Memory:") || line.trim().startsWith("Manufacturer:")){
                  System.out.println(line.trim());
              }
          }
      } catch (IOException | InterruptedException ex) {
          ex.printStackTrace();
      }

  }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question