Choosing the main GPU

Discussion in 'Videocards - NVIDIA GeForce Drivers Section' started by ParKur, Nov 13, 2021.

  1. ParKur

    ParKur Member

    Messages:
    34
    Likes Received:
    3
    GPU:
    RTX 3090/RTX 2080Ti
    Greetings.
    Maybe there are those who have faced this task.
    There are 2 different GPUs in one system. Is it possible to assign/specify for an application to use a specific GPU?
     
  2. theahae

    theahae Active Member

    Messages:
    62
    Likes Received:
    12
    GPU:
    GTX 1060
    i think windows 11 supports this feature but not sure.
     
  3. DannyD

    DannyD Ancient Guru

    Messages:
    5,248
    Likes Received:
    3,143
    GPU:
    evga 2060
    I've a multi-gpu win11 rig if you want me to test anything.
     
  4. ParKur

    ParKur Member

    Messages:
    34
    Likes Received:
    3
    GPU:
    RTX 3090/RTX 2080Ti
    Is it possible to assign a specific GPU to an application?
    I assume that this function works only when there is a built-in graphics in the system.
     

  5. DannyD

    DannyD Ancient Guru

    Messages:
    5,248
    Likes Received:
    3,143
    GPU:
    evga 2060
    My multi gpu rig runs off built in graphics, i've no idea how to go about assigning a specific GPU to an application tho.
     
  6. Martigen

    Martigen Master Guru

    Messages:
    517
    Likes Received:
    241
    GPU:
    GTX 1080Ti SLI
    How bizarre, I've been investigating the same thing the last few days.

    So firstly, no Windows doesn't let you do this -- the option to choose a GPU to assign an app only works if you have a system with both an integrated GPU (iGPU) and dedicated GPU (dGPU). Basically, laptops. It's there so you can run an app on the more power-friendly integrated GPU in the CPU.

    @ParKur this is a solution I found with some googling:

    https://github.com/ITCMD/RunAsGpu

    It's a simple solution that disables the primary GPU, launches your desired program -- which now naturally attaches to the only GPU in the system, the 2nd one -- and then re-enables the primary GPU again.

    However, for my system at least, I had to do a little fluffing to it to get it disable my primary GPU as using SLI the initial device IDs were identical for both GPUs, but eventually figured out how to specify the primary one. If you have two GPUs of different models, this won't be necessary and the batch file should work fine.

    If you have SLI or for anyone reading this who has SLI, you need to alter the batch file and explicitly state the extended device id. E.g, originally the RunAsGPU batch file calling devcon.exe pulled out just this id:
    Code:
    PCI\VEN_10DE&DEV_1B06
    
    Which happens to match both 1080Tis in my system. I needed to specify the full device ID. So first ran devcon.exe to find this:
    Code:
    devcon.exe hwids PCI\VEN_10DE&DEV_1B06
    
    And note the extended ID at the top. Then add this to the batch file, but note you need to add the '@' operator to specify a device instance. My final batch file then for eg looks like this:
    Code:
    devcon.exe disable "@PCI\VEN_10DE&DEV_1B06&SUBSYS_36021462&REV_A1\4&15E7D2AB&0&0010"
    timeout /t 2 /nobreak >nul 2>nul
    start "" "<YOUR PROGRAM HERE WITH PATH>"
    timeout /t 2 /nobreak >nul 2>nul
    devcon.exe enable "@PCI\VEN_10DE&DEV_1B06&SUBSYS_36021462&REV_A1\4&15E7D2AB&0&0010"
    
    It's a kludgy solution, but it works :) I'm actually surprised Windows doesn't let you do this natively, there's loads of reasons to run programs on a spare GPU, but googling this was the only thing that really popped up (amid the 99% of 'Use the Windows feature here..." which was for iGPU/dGPU only as above. So many people misunderstand the question here). Maybe a programmer out there can write something to do this properly instead of disabling/enabling a device while the system is running.
     
  7. Astyanax

    Astyanax Ancient Guru

    Messages:
    15,325
    Likes Received:
    6,274
    GPU:
    GTX 1080ti
    Windows 11 does.
     
  8. ParKur

    ParKur Member

    Messages:
    34
    Likes Received:
    3
    GPU:
    RTX 3090/RTX 2080Ti
    DannyD, here is an article about where this is done.

    Martigen,
    with the GPU disabled, the option is not suitable. Since in this case it will not be difficult to turn off and turn on the GPU with your hands. It is necessary that the GPUs are not disabled, but assigned to the main ones for different applications.
    I was looking for information, but I didn't find anything except one screenshot.
    [​IMG]

    Astyanax,
    it would be good to know for sure that in windows 11 it works without eGPU


     
  9. Astyanax

    Astyanax Ancient Guru

    Messages:
    15,325
    Likes Received:
    6,274
    GPU:
    GTX 1080ti
    It does.

    But alternatively, you don't need to disable the device, you can set a display on the other gpu (if you haven't already) and set that monitor as primary, most dx applications will always start on the gpu attached to the primary monitor.

    Then switch back to start your game on the one you want to game on.
     
  10. DannyD

    DannyD Ancient Guru

    Messages:
    5,248
    Likes Received:
    3,143
    GPU:
    evga 2060

  11. Martigen

    Martigen Master Guru

    Messages:
    517
    Likes Received:
    241
    GPU:
    GTX 1080Ti SLI
    I stand corrected! I haven't upgraded yet, and it didn't turn up in googling. Good to know for future :)

    Yep that was another option I found, but not good for me at least as I'm often using SLI and monitors all need to be connected to primary card, too much fluffing about with cables to switch things around.
     
  12. ParKur

    ParKur Member

    Messages:
    34
    Likes Received:
    3
    GPU:
    RTX 3090/RTX 2080Ti
    Astyanax, maybe I'll try. My monitor is already connected to the card I need and everything is output to it, but not all applications use the necessary GPU.

    DannyD, this pleases, it remains to find out how it works without eGPU
     
  13. ParKur

    ParKur Member

    Messages:
    34
    Likes Received:
    3
    GPU:
    RTX 3090/RTX 2080Ti
  14. Astyanax

    Astyanax Ancient Guru

    Messages:
    15,325
    Likes Received:
    6,274
    GPU:
    GTX 1080ti
    all this does is automate the process of turning off the gpu.
     
  15. ParKur

    ParKur Member

    Messages:
    34
    Likes Received:
    3
    GPU:
    RTX 3090/RTX 2080Ti
    I installed Win 11 for the test, there was a choice between GPUs.
    d_GPU.png
     

Share This Page