Qt program uses wrong video card
Hey,
I've made an application using qt creator, but when I run the application in qt creator it crashes because it is using the wrong video card. When I run the application on it's own it does use the right video card.
I've selected in nvidia configuration screen to use higher end video card, but this doesn't work. Video card drivers are up to date. Reinstalling video drivers doesn't work.
Can someone help me with this plz? :)
Re: Qt program uses wrong video card
Quote:
I run the application in qt creator it crashes because it is using the wrong video card.
On what evidence do you base this assertion? What environment is Qt Creator providing the child process? What cards? What OS? Which Qt version? Which Qt features are you using?
Re: Qt program uses wrong video card
I use the function: glGetString(GL_VERSION)
I find out it is using my intel GPU and not my nvidia GPU. (geforce gt540m)
The intel card supports opengl 3.0 and the nvidia card supports 3.3. Im using functions for opengl 3.3, this is why it crashes.
Im running it on windows 10, qt version 5.6. The program is the begin of a game, it shows a character on the screen using the opengl functions of qt.
Re: Qt program uses wrong video card
Do you have the option to start a program using a particular GPU? On my laptop this is in the right-click context menu. If so, try running Qt Creator by explicitly selecting the nVidia card and then see if, when Creator launches your program it still has the wrong GPU.
Re: Qt program uses wrong video card
Im sorry I can't find it. Could you be more specific where this menu is?
Re: Qt program uses wrong video card
Quote:
On my laptop this is in the right-click context menu.
Might depend on how you've configured your graphics drivers. I have Nvidia's Nsight HUD ("Heads up display") installed, and the right-click menu gives me the option of starting under that (but nothing else graphics-related).
Re: Qt program uses wrong video card
You can active your Geforce/Radeon video by adding this code:
Code:
#ifdef _WIN32
#include <windows.h>
extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001;
#endif
#include "widget.h"
#include <QApplication>
int main(int argc, char *argv[])
{
Widget w;
w.show();
return a.exec();
}