This topic has been locked
xSOSxHawkens Jan 28, 2018 @ 1:13am
Manually bind which GPU a program uses?...
Skippable preface: I guess in my first post I was too specific to the programs in question and the result was that the thread got moved to a non-applicable section of the forums, where I was then told I needed to re-post it into three other forums which were also not on topic. Instead of people understanding that I am asking a question about Windows and how it interacts with my hardware everyone got lost on the word “steam” in the post and apparently thought it was not hardware or OS related...

Therefore I have stripped my request down to the absolute basics so as to show that this is clearly a question regarding how to use my OS (windows 10) and my hardware (two separate GPU's) in an advanced way...






TL:DR How do I manually bind which GPU a program executes onto, prior to launching said executable, in a multi GPU, multi vendor system?





Situation:

One computer, with two separate graphics cards, identified by Windows 10 as GPU-0 and GPU-1.

Two separate screens, Screen-1 (SC1) run by GPU-1 and Screen-2 (SC2) run by GPU-0

SC-1 and GPU-1 are main screen and main GPU, SC2 and GPU-0 are secondary screen and GPU.

Two programs that are 3d rendered,. One heavy 3D rendering (prog-1) and one light 3D rendering (pro-2).




Desired result: When launched, have Prog-2 execute and render on GPU-0 on SC-2, while Prog-1 launches on the main screen SC1 rendered by GPU-1.



Possible solutions?

Launch flags similar to how you would bind an exe or process to operate with a pre-defined pre-launch affinity, as seen here:

https://stackoverflow.com/questions/7759948/set-affinity-with-start-affinity-command-on-windows-7



Being that Windows allows the setting of CPU affinity on launch through command line arguments, it would stand to reason that now that Windows 10 can clearly differentiate between GPU-0 and GPU-1 as separate devices that there * should * be a way for me to manually assign which GPU I want a specific EXE to run on before launch...


How?
Last edited by xSOSxHawkens; Jan 28, 2018 @ 1:36am

Something went wrong while displaying this content. Refresh

Error Reference: Community_9721151_
Loading CSS chunk 7561 failed.
(error: https://community.fastly.steamstatic.com/public/css/applications/community/communityawardsapp.css?contenthash=789dd1fbdb6c6b5c773d)
< 1 2 3 >
Showing 16-30 of 36 comments
Spec_Ops_Ape Jul 14, 2019 @ 8:40am 
Windows 10 introduced something that may be of use to you, came in after your initial post.
https://www.tenforums.com/tutorials/103965-set-preferred-gpu-apps-windows-10-a.html
Spec_Ops_Ape Jul 14, 2019 @ 8:44am 
Otherwise have you looked into .bat files to run the application on specific device id? I had a quick look but didn't come across anything, you can run programs with these but not sure about flags for being more specific to device id.
Powershell may be another option.
Gunjoe Jul 14, 2019 @ 1:31pm 
That windows 10 feature is helpful for laptops and those dealing with integrated gpus, it is certainly a good thing. In some cases (im using mine as an example) there are two dedicated gpus and for whatever reason, the primary (GPU-0) one will be the option for both power saving and performance, thus rendering the options useless sadly. batch files may be usable, but im unsure if they can do more than equivalent to right clicking and choosing a gpu from the context menu.
Scallywag Aug 1, 2019 @ 9:29am 
I have been looking this up of this for litterly years and have not found much, however there is a dirty way go get this to work. If you disable the primary graphics card in device manager then all currently open programs will run on the secondary card.

Then when you re-enable the primary graphics card all programs you open from then on are run on the primary card while the others are still running on the seconday.

This can cause crashes with certain programs but does work fine for chrome and quite a few others.

I wish there was a way to hack the nvidia software to trick it into thinking it is running mobile graphics card and enable the "run on gpu option." Does anyone know how to do this?
Scallywag Aug 1, 2019 @ 9:31am 
You can check what's running on what using the Nvidia GPU Activity program (Enabled in nvidia control pannel)
klesun Apr 24, 2020 @ 2:50pm 
Did not read all other comments, just wanted to share a working solution with which I ran Chrome on GPU 0, whereas all my other system apps ran on GPU 1. Same worked with Minecraft and Dota, and I believe will work with any other app.

- You need a separate monitor plugged in each of the GPUs
- Before launching the app, go to windows Display Settings, choose the display plugged in the GPU you want to run app on and mark it as "Make this my main display"
- Launch the app
- Go back to Display Settings and return your usual main display

Do some activity in the app you launched and look in the task manager (you can show an optional "GPU Engine" column) - you'll see that load from the app comes to the GPU you chose.

P.S. better make sure the app window stays on the display plugged to this GPU, since in Chrome for example moving it to other display causes big lags on scrolling a page and GPU usage on Desktop Window Manager process
Last edited by klesun; Apr 24, 2020 @ 3:01pm
🆂tartup🆃im Apr 24, 2020 @ 3:57pm 
Thanks yea I've seen that method.

I wonder if there is a programmatic way though to do this. I definitely could code it into something easier to use. I would use it myself for sure!
Washell Apr 24, 2020 @ 4:50pm 
https://github.com/microsoft/PowerToys/tree/master/src/modules/fancyzones

Fancy Zones is a window manager that is designed to make it easy to arrange and snap windows into efficient layouts for your workflow and also to restore these layouts quickly. Fancy Zones allows the user to define a set of window locations for a desktop that are drag targets for windows. When the user drags a window into a zone, the windows is resized and repositioned to fill that zone.
It has an option to automatically move windows to their last zone. So it would move it to your display and thus GPU of choice.

xSOSxHawkens Apr 24, 2020 @ 7:10pm 
Figured I would post an update for those wondering. At least form what I have experianced, though many of these options do indeed push Steam over onto the other GPU, what I have found is that Steam will then force launch the game using whatever GPU it is running on, regardless of the screen the game opens on.

So if you lock steam to screen 2 and GPU1, it will launch the game on screen 1 but still render it on the core of GPU1 and just push it out via passthrough.

Kinda sucks :/
klesun Apr 25, 2020 @ 2:28pm 
@xSOSxHawkens, just to make sure I made myself clear enough, here is a screenshot:


You can see (in the top-left corner) me running "Age of Empires" on GPU 1 - 70.8% and "7 Days To Die" on GPU 0 - 42.5% simultaneously using the method I described above

The trick is not to change the main display before you launch Steam launcher itself, but to change just before you hit "Play" on a game in the launcher.

Hope this will be helpful for people coming here. I almost lost hope to get use of my multigpu setup when I googled this stuff the first time and just accidentally noticed this Main Display workaround...
Last edited by klesun; Apr 25, 2020 @ 2:43pm
Trabancheto Jan 4, 2021 @ 9:05am 
Well on windows 10 insider preview version 20190 and up microsoft added function to select specific GPU par app.
🆂tartup🆃im Jan 5, 2021 @ 8:10pm 
Originally posted by Trabancheto:
Well on windows 10 insider preview version 20190 and up microsoft added function to select specific GPU par app.
I did some researching and couldn't find this, could you explain more please?
sawdust3d Jan 6, 2021 @ 1:02am 
Originally posted by 🆂tartup🆃im:
Originally posted by Trabancheto:
Well on windows 10 insider preview version 20190 and up microsoft added function to select specific GPU par app.
I did some researching and couldn't find this, could you explain more please?

Yes, please. I too would like to know.
Bad 💀 Motha Jan 6, 2021 @ 1:34am 
On a Desktop PC, what GPU is used is dictated what which Display is connected where.

Lets say my PC has Intel HD/UHD (GPU-0) + NVIDIA GTX/RTX (GPU-1)

Connecting a Display to the Intel GPU (the Motherboard video outputs) would dictate this screen to only ever use the Intel GPU. This would be used as say, an addon accessory Display. Connecting another Display to the dedicated GPU card would dictate that this Display only uses that GPU. So when launching Games for example, you'd want them to run on the Display using the dedicated GPU card. In many modern games, you can select in-game which Display # or which GPU the game uses.

Unless you have a low budget PC though, there would be no real reason to connect any Display to the Intel GPU and simply connect all (up to 3 or 4, depending on actual GPU card) Displays to the dedicated GPU instead.

Never use an Insider Edition of Win10 (which is basically a beta) for Gaming, unless you are a Dev or Tester. As this does not get along well with many games, nor Drivers.
Last edited by Bad 💀 Motha; Jan 6, 2021 @ 1:35am
🆂tartup🆃im Jan 9, 2021 @ 12:57am 
Originally posted by Bad 💀 Motha:
On a Desktop PC, what GPU is used is dictated what which Display is connected where.

I tried that and it doesn't appear to be correct. The default Windows appears to use the primary display adapter GPU for rendering the desktop + GPU GD.
< 1 2 3 >
Showing 16-30 of 36 comments
Per page: 1530 50

Date Posted: Jan 28, 2018 @ 1:13am
Posts: 36