Running your OpenGL program on an Nvidia-Optimus enabled laptop

Started by
3 comments, last by oggs91 11 years, 7 months ago
Running my OpenGL 4.0 programs on my laptop (using nvidia-optimus technology), always defaults to the integrated Intel graphics chip, instead of the dedicated Nvidia GTX 660M that's included. This results in my program failing to initialize because the Intel chip only supports OpenGL 1.4.

Is there anyway to tell the system which graphics card to use without manually setting up a profile for the application? I'd rather not disable optimus altogether, so I can still gain the benefits of power savings while not running high-end applications. How do commercial games handle this?
Advertisement
to answer your question with a maybe, no smile.png
this is not something that there is any standard for
anyone that has a double-card laptop needs to change this for themselves
usually with a dedicated keyboard button, or a program that comes with the computer

as for using profiles, i think that is for convinience mostly..
perhaps the most common games out there get a dedicated profile that comes with your drivers

the best source of information i could find:
http://us.download.nvidia.com/XFree86/Linux-x86_64/295.20/README/configlaptop.html
Usually, the drivers can tell what's a game or application that is supposed to use the discrete GPU based on the profiles/filenames available at the time the driver was delivered. The drivers weren't released with details of applications you develop, though, so you'll probably need to add your executable to the whitelist. There's a video that walks through the process here.

Note: I haven't tried this process for an app under development, so I'm not sure what happens when the file is being constantly deleted/recreated, but it could handle it well!
Adding the application to the whitelist did the trick - even when executing the .exe through the Visual Studio debugger, and after deleting using clean. This solution wil work for me, though it's a shame there isn't a more automatic way of doing this. I guess if you're a big time developer/gamestudio you can just call nvidia and have them release a driver with your app on the whitelist.

Thanks for the help
i have a dell XPS502L laptop with an I7 and a nvidia 540m ... i had the same problem with visual studio and opentk ... mysolution: running visual studio by rightclicking the link to open the context menu and choose "Mit Grafikprozessor ausführen" (sry german, "run by graphicsprocessor"?)

This topic is closed to new replies.

Advertisement