Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Selecting better gpu in a dual graphics system?  (Read 5436 times)

0 Members and 1 Guest are viewing this topic.

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Selecting better gpu in a dual graphics system?
« on: April 23, 2014, 03:45:54 am »
Does anyone know how to programmatically force Windows to select the better GPU in a dual graphics system? (e.g., a laptop with a nvidia chipset and intel integrated graphics)

My SFML-based game seems to use the integrated graphics, unless I explicitly right-click the executable and choose "run with nvidia graphics". Running with the good graphics improves the frame-rate dramatically, so I'd like to know if there's a way to make this the default for anyone running the game? (Also, ideally I don't want to bundle an installer with the game.)


dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: Selecting better gpu in a dual graphics system?
« Reply #1 on: April 23, 2014, 04:08:11 am »
Usually the user sets the default gpu to run stuff on, not the programmer.

I haven't used Windows in a while, so I'm not 100% sure, but I believe you do it through the Nvidia settings.

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: Selecting better gpu in a dual graphics system?
« Reply #2 on: April 23, 2014, 04:20:22 am »
Thanks for the reply.

Yeah I've manually set it on my own system to use the fast GPU for my game, but most games that I run use it by default -- typically the indie games I run don't use it by default. I suspect there's some program that you run in an installer to tell the nvidia card your game needs to use it, but I was hoping there was some environment variable or some other method that can avoid using an installer (at least for the beta versions.)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
AW: Selecting better gpu in a dual graphics system?
« Reply #3 on: April 23, 2014, 08:04:26 am »
You usually get a systen wide setting somewhere, not just on application basis.
Howevef if there is such an option, it won't be cross-platform and SFML doesn't provide it, thus you might want to ask somewhere else (e.g. SO).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: Selecting better gpu in a dual graphics system?
« Reply #4 on: April 24, 2014, 02:12:51 am »
No worries, thx. I'm surprised no-one has encountered this before -- a forum search shows nothing. Even running the SFML demos will use the integrated gfx, so by default will run a lot slower for most people -- but I suppose they aren't really stress tests so maybe nobody notices? In any case, I'll research this further on other sites.

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: Selecting better gpu in a dual graphics system?
« Reply #5 on: April 24, 2014, 04:51:48 am »
No worries, thx. I'm surprised no-one has encountered this before -- a forum search shows nothing. Even running the SFML demos will use the integrated gfx, so by default will run a lot slower for most people -- but I suppose they aren't really stress tests so maybe nobody notices? In any case, I'll research this further on other sites.

lol not stress testing?  ???  You should see how many sprites are on my screen at any given time. :)
I have many ideas but need the help of others to find way to make use of them.

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: Selecting better gpu in a dual graphics system?
« Reply #6 on: April 24, 2014, 06:00:03 am »
No worries, thx. I'm surprised no-one has encountered this before -- a forum search shows nothing. Even running the SFML demos will use the integrated gfx, so by default will run a lot slower for most people -- but I suppose they aren't really stress tests so maybe nobody notices? In any case, I'll research this further on other sites.

lol not stress testing?  ???  You should see how many sprites are on my screen at any given time. :)

I meant that the SFML demos aren't stress tests. I realise many people are doing intensive things with SFML, which makes it weird that this issue hasn't seemed to come up.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
AW: Re: Selecting better gpu in a dual graphics system?
« Reply #7 on: April 24, 2014, 08:27:31 am »
No worries, thx. I'm surprised no-one has encountered this before -- a forum search shows nothing. Even running the SFML demos will use the integrated gfx, so by default will run a lot slower for most people -- but I suppose they aren't really stress tests so maybe nobody notices?
Or not everyone has two GPUs and those who have might not all have that issue. ;)

On how many different setups did you test?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: Selecting better gpu in a dual graphics system?
« Reply #8 on: April 24, 2014, 09:03:15 am »
No worries, thx. I'm surprised no-one has encountered this before -- a forum search shows nothing. Even running the SFML demos will use the integrated gfx, so by default will run a lot slower for most people -- but I suppose they aren't really stress tests so maybe nobody notices?
Or not everyone has two GPUs and those who have might not all have that issue. ;)

On how many different setups did you test?


Many laptops are dual graphics these days. I think the Macbook Pro's switch automatically whenever OpenGL is used in an application, but unfortunately it doesn't seem the same for Windows. Nvidia switches whenever it detects a DirectX or Cuda call, but not OpenGL call; however there's an nvidia library you can use to create an application profile. In case anyone stumbles across this problem I'll leave these links here:

http://docs.nvidia.com/gameworks/content/gameworkslibrary/coresdk/nvapi/group__drsapi.html
http://www.opentk.com/node/3144

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Selecting better gpu in a dual graphics system?
« Reply #9 on: April 24, 2014, 10:26:23 am »
I think the Macbook Pro's switch automatically whenever OpenGL is used in an application
Yes, on Mac this is automatically handled by the OS.
SFML / OS X developer