OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Setting OpenGL and graphics card settings prgrammatically?


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Chris Hanson
Guest





PostPosted: Thu May 10, 2018 6:16 pm    Post subject:
Setting OpenGL and graphics card settings prgrammatically?
Reply with quote

  As you are aware, drivers like the NVidia Windows driver have a variety of tuneable settings accessible through the vendor-specific setting application. Many times these accomplish things that can't be accessed through the standard OpenGL APIs or extensions.



  Is there any way to force settings (like use of dedicated GPU versus integrated GPU) from application code via an API?


  Basically, we're trying to avoid having to teach the untrained user how to mess with those settings when we know the preferred settings for the application.


  Interested in NVidia and optionally AMD, Windows primarily but cross-platform APIs are welcomed.


  I'm digging into this: https://docs.nvidia.com/gameworks/index.html#gameworkslibrary/coresdk/gsa_api.htm


  to see if it does what I want, but welcome input from others.


--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
Daniel Emminizer, Code...
Guest





PostPosted: Thu May 10, 2018 6:19 pm    Post subject:
Setting OpenGL and graphics card settings prgrammatically?
Reply with quote

Hi Chris,

Not sure if this is what you’re looking for, but you can give a hint to the drivers by exporting variables in your code. In my main.cpp I do something like:

#ifdef WIN32
extern "C" {

/// Declare this variable in public to enable the NVidia side of Optimus - http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
__declspec(dllexport) int NvOptimusEnablement = 1;

/// Declare this variable in public to enable the AMD side of AMD Switchable Graphics (13.35 driver or newer needed) - http://devgurus.amd.com/thread/169965
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;

}
#endif /* WIN32 */


We have not had a problem since.

- Dan



From: osg-users [mailto:] On Behalf Of Chris Hanson
Sent: Thursday, May 10, 2018 2:15 PM
To: OpenSceneGraph Users
Subject: Setting OpenGL and graphics card settings prgrammatically?

  As you are aware, drivers like the NVidia Windows driver have a variety of tuneable settings accessible through the vendor-specific setting application. Many times these accomplish things that can't be accessed through the standard OpenGL APIs or extensions.

  Is there any way to force settings (like use of dedicated GPU versus integrated GPU) from application code via an API?

  Basically, we're trying to avoid having to teach the untrained user how to mess with those settings when we know the preferred settings for the application.

  Interested in NVidia and optionally AMD, Windows primarily but cross-platform APIs are welcomed.

  I'm digging into this: https://docs.nvidia.com/gameworks/index.html#gameworkslibrary/coresdk/gsa_api.htm

  to see if it does what I want, but welcome input from others.



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]


------------------
Post generated by Mail2Forum
Back to top
Wojtek
User


Joined: 02 Nov 2011
Posts: 88

PostPosted: Thu May 10, 2018 6:24 pm    Post subject:
Setting OpenGL and graphics card settings prgrammatically?
Reply with quote

Hi, 

AFAIK there is also a https://developer.nvidia.com/nvapi library. Unfortunately I have no personal experience with this but I believe it can be used to prgramatically override the setings usually set with NVidia Control Panel.


Cheers,
Wojtek 





2018-05-10 20:18 GMT+02:00 Daniel Emminizer, Code 5773 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
Hi Chris,

Not sure if this is what you’re looking for, but you can give a hint to the drivers by exporting variables in your code.  In my main.cpp I do something like:

#ifdef WIN32
extern "C" {

  /// Declare this variable in public to enable the NVidia side of Optimus - http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
  __declspec(dllexport) int NvOptimusEnablement = 1;

  /// Declare this variable in public to enable the AMD side of AMD Switchable Graphics (13.35 driver or newer needed) - http://devgurus.amd.com/thread/169965
  __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;

}
#endif /* WIN32 */


We have not had a problem since.

 - Dan



From: osg-users [mailto: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)] On Behalf Of Chris Hanson
Sent: Thursday, May 10, 2018 2:15 PM
To: OpenSceneGraph Users
Subject: Setting OpenGL and graphics card settings prgrammatically?

  As you are aware, drivers like the NVidia Windows driver have a variety of tuneable settings accessible through the vendor-specific setting application. Many times these accomplish things that can't be accessed through the standard OpenGL APIs or extensions.

  Is there any way to force settings (like use of dedicated GPU versus integrated GPU) from application code via an API?

  Basically, we're trying to avoid having to teach the untrained user how to mess with those settings when we know the preferred settings for the application.

  Interested in NVidia and optionally AMD, Windows primarily but cross-platform APIs are welcomed.

  I'm digging into this: https://docs.nvidia.com/gameworks/index.html#gameworkslibrary/coresdk/gsa_api.htm

  to see if it does what I want, but welcome input from others.



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]


_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts osglight demo problems with Intel gra... eventhorizon5 General 2 Mon Jul 09, 2018 8:52 pm View latest post
No new posts Graphics context issues eventhorizon5 General 6 Mon Jul 09, 2018 7:00 am View latest post
No new posts OpenGL function does not return on Ti... errno General 1 Mon Jun 11, 2018 1:02 pm View latest post
No new posts How do I create a graphics context on... srinivas General 3 Tue Apr 24, 2018 11:40 am View latest post
No new posts problem setting texture min/mag filter antiro42 General 8 Mon Feb 12, 2018 7:51 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP