JOCL icon indicating copy to clipboard operation
JOCL copied to clipboard

[Question] How to get platform and device information?

Open HamedSharifian opened this issue 3 years ago • 1 comments

I have a device with 2 GPUs:

  • Intel(R) HD Graphics 520
  • NVIDIA GeForce 940MX GPU-Z shows that OpenCL is enabled and is working on both. I get 2 platforms when I obtain platform Ids using JOCL, but I don't know which device is in use! I wonder if I could know how can I get "device name" or its "vendor" using the platform Id?

HamedSharifian avatar Nov 06 '21 12:11 HamedSharifian

The https://github.com/gpu/JOCLSamples/blob/master/src/main/java/org/jocl/samples/JOCLDeviceQuery.java sample might be what you're looking for. It iterates through all platforms, and all devices for each platform, and prints the name and vendor of each device (together with lots of further technical information).

gpu avatar Nov 12 '21 20:11 gpu