I'm new to graphics programming, though not to coding generally. I've been learning opengl from the OpenGL Superbible, 6th Edition. I was trying out the shader examples from the book but couldn't get them to work. The logged error says approximately "incorrect #version". The book uses GLSL 4.3 core.

I ran glewinfo.exe and the generated text file said that the core OpenGL version on my system was OpenGL 4.0, but it was the stats of my integrated Intel GPU, not my Nvidia GT720m GPU. I'm pretty sure the nvidia gpu supports a higher opengl version.

How do I get GLEW to detect the high-performance GPU and make calls to the Nvidia drivers instead of the integrated Intel HD GPU?

A similar question has been asked there, but it concerned only running the program on the gpu. How do I tell which version of OpenGL the Nvidia GPU supports?


1 Answer 1


You didn't mention your platform, but assuming it is Windows, this blog post appears to address your exact question, between OpenGL 4.0 vs 4.3 on integrated vs nvidia gpus:


It mentions using the "NVIDIA Control Panel" to change from autoselect to specifically the nvidia card. And that on a laptop, your selection would be influenced by battery life.

  • \$\begingroup\$ Thanks a lot! That's exactly what I was looking for. I did have to figure out that one needs to include "Windows.h" for the code to work and export the variable which forces the program to call the Nvidia drivers. \$\endgroup\$ Commented Mar 29, 2015 at 20:40
  • \$\begingroup\$ I just came back to this question after a while... when I gave the answer I hadn't actually started my Windows port. Nearly a year later I got my Alienware laptop (which switchable GPUs) and got to apply this exact info. :-) \$\endgroup\$ Commented Mar 27, 2016 at 15:52
  • \$\begingroup\$ You can export the NvOptimusEnablement variable as a DWORD, with which you can tell the driver that you are a game (if the value is 1) and a NVidia GPU is better fit. \$\endgroup\$ Commented Feb 11, 2019 at 9:24
  • \$\begingroup\$ stackoverflow.com/a/14041061/3897333 Code in linked answer. \$\endgroup\$ Commented Feb 11, 2019 at 9:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .