9

I would like to know the Graphics Card Model Name in OpenGL or in Win32 cuz I have a memory leaks bug on a specific kind of Graphics Card (only Intel HD not all Intel).

This is the bug : https://software.intel.com/en-us/forums/developing-games-and-graphics-on-intel/topic/280679

The Vendor Name in OpenGL is not enough. Does someone know a way to get the name of the graphical card different than using Direct3D ? Or do you think that I can use D3D and OpenGL together? Get the graphics card model?

Community
  • 1
  • 1
John Smith
  • 771
  • 4
  • 11
  • 25
  • The foolproof method for determining the installed GPU type is to directly enumerate the hardware. In Linux you'd either call `lspci` and parse its output or traverse `/sys/bus/pci/devices/*` looking for all devices being of the class `0x030000` (graphics controllers). My Google-Fu failed me finding the right APIs for doing this on modern Windows machines. It's certainly not part of the Win32 API and changes with each bump of the Windows driver programming model. – datenwolf Feb 15 '17 at 10:18
  • 2
    That method is not foolproof, since it is not guaranteed, that the installed device is used by the application and in the requested context. Driver problems or software switches may prevent this. And it is quite common on laptops with more than one graphics card, that a powerful card is installed but not used. – OutOfBound Feb 15 '17 at 12:36
  • Unrelated, but uhhhhh.... did two people in the Intel forum post actually take the time to try and help an SEO bot? – Robert Rouhani Feb 15 '17 at 12:36

1 Answers1

15

You can get all the information via the OpenGL Api.

https://www.khronos.org/opengl/wiki/Get_Context_Info

const GLubyte* vendor = glGetString​(GL_VENDOR); // Returns the vendor
const GLubyte* renderer = glGetString​(GL_RENDERER); // Returns a hint to the model

In my case the renderer returns the following string: "GeForce GT 750M/PCIe/SSE2"

I don't know, what it would return for Intel or Amd cards. To my knowledge the format of the string and it's content is up to the implementation.

OutOfBound
  • 1,914
  • 14
  • 31
  • I dont have the Video Card here. I will check it the next week ! – John Smith Feb 20 '17 at 09:52
  • Have you tried it out? I am interested, how it turns out on non NVIDIA cards. – OutOfBound Mar 09 '17 at 16:24
  • 1
    I tried on a intel hd video card and I have glrender = "Intel HD something" – John Smith Mar 13 '17 at 14:27
  • 1
    I tried on my Intel card and I´ve got ..VENDOR: Intel ... MODEL: Intel(R) HD Graphics 620 ... thanks – Trucker Apr 21 '20 at 12:30
  • 5
    For anyone coming here from a search engine and wondering what to do with the strange `GLubyte*` type returned by `glGetString`, it seems sufficient to just cast it to `char*` if you want to supply it to `printf` or construct an `std::string` from it. – Alexandre Jun 01 '20 at 14:49
  • As far as I understand, I need to setup a context to retrieve more than an empty string from this function. Can someone help we on how to set up such a context? – prog2de May 26 '22 at 09:20