Up until today I've been exporting NvOptimusEnablement to enable the NVidia card in my laptop (which also has an Intel card for 2D.) For whatever reason, it stopped working mysteriously this week which led to an hour of trying to figure out why it was all of a sudden taking 3 seconds to render each frame (Intel OpenGL is really, really sad.)
The first step was to make sure I didn't waste time on this problem again in the future, so I added a popup when an Intel GPU is detected in the OpenGL vendor string like this:
#include <windows.h>
#include <sal.h>
#include "nvapi.h"
// Force NVidia Optimus to use NVidia GPU on drivers 302 and later.
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
extern "C" {
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}
namespace Lair
{
// When NvOptimusEnablement fails, maybe this will work, linking NVapi.
class nVidia
{
public:
nVidia( void )
: ret( NvAPI_Initialize() )
{
}
~nVidia()
{
if ( ret == NVAPI_OK )
{
NvAPI_Unload();
}
}
NvAPI_Status ret;
};
// Global, so this gets executed with no other outside code.
nVidia gNvApi;
}
We were unable to retrieve our session cookie from your web browser. If pressing F5 once to reload this page does not get rid of this message, please read this to learn more.
You will not be able to post until you resolve this problem.
Homepage: onemanmmo.com email:one at onemanmmo dot com
Homepage: onemanmmo.com email:one at onemanmmo dot com
Homepage: onemanmmo.com email:one at onemanmmo dot com
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
Homepage: onemanmmo.com email:one at onemanmmo dot com