Hey guys, I wonder how to more conveniently split the load between multiple GPUs for DirectX or OpenGL apps/games on Windows. I want to App A to be rendered by GPU A and App B to be rendered by GPU B.
I'm not talking about SLi or other ways to make two GPUs render a single game, I even want to mix multiple GPU brands.
For compute tasks (eg. CUDA/OpenCL) it's pretty easy as all apps I know of ask which device to use:
OpenGL: Since I own two NVIDIA GPUs, selecting which GPU renders OpenGL app is just a matter of clicking on it in the context menu, but this is NVIDIA driver only feature.
DirectX: It's more complicated as not every game/app allows selecting the rendering device. To bypass that I used EnableMsHybrid registry "hack" which shows two GPUs as Power saving or High performance in Windows Settings.
Now say, I have three GPUs in the system. I'm not sure if that registry hack would work, I'd imagine setting first GPU as High performance, second as Power Saving, and third unspecified, aka as Let Windows Decide. It might work, or it might not. I've seen some screenshots with extra entry in this menu - Specific GPU but I don't have it.
If I would run an NVIDIA + AMD GPU in the system, for OpenGL apps, the context menu feature would not work anymore.
So here is my question, is there some more convenient (preferably as convenient as the context menu), universal method for specifying which GPU is the rendering device for the selected OpenGL/DirectX app on windows? Or other that would work with more than two GPUs?
And also, is it possible to render Windows (Explorer, etc) on the GPU that is not the one with displays connected? From my testing, connecting a single display to GPU A and setting "Make this my main display" in settings, and then two more displays to GPU B makes GPU A just send the rendered images to GPU B for those 2 monitors. It's the same story for those USB DisplayLink "graphics cards"/docking stations. So now, how to achieve that without any displays connected?
****************** [EDIT] ***************************
...anyway, made myself a custom context menu. Seems to be working for DirectX and Vulkan apps. OpenGL still managed by NVIDIA driver, unsure how to do this with mixed GPU brands or on system without NVIDIA gpu.
For anyone interested:
Registry file (.reg)
MsHybridSetGpu.bat file:
There also has to be a DWORD Value "EnableMsHybrid" for each GPU in registry in
I'm not talking about SLi or other ways to make two GPUs render a single game, I even want to mix multiple GPU brands.
For compute tasks (eg. CUDA/OpenCL) it's pretty easy as all apps I know of ask which device to use:
OpenGL: Since I own two NVIDIA GPUs, selecting which GPU renders OpenGL app is just a matter of clicking on it in the context menu, but this is NVIDIA driver only feature.
DirectX: It's more complicated as not every game/app allows selecting the rendering device. To bypass that I used EnableMsHybrid registry "hack" which shows two GPUs as Power saving or High performance in Windows Settings.
Now say, I have three GPUs in the system. I'm not sure if that registry hack would work, I'd imagine setting first GPU as High performance, second as Power Saving, and third unspecified, aka as Let Windows Decide. It might work, or it might not. I've seen some screenshots with extra entry in this menu - Specific GPU but I don't have it.
If I would run an NVIDIA + AMD GPU in the system, for OpenGL apps, the context menu feature would not work anymore.
So here is my question, is there some more convenient (preferably as convenient as the context menu), universal method for specifying which GPU is the rendering device for the selected OpenGL/DirectX app on windows? Or other that would work with more than two GPUs?
And also, is it possible to render Windows (Explorer, etc) on the GPU that is not the one with displays connected? From my testing, connecting a single display to GPU A and setting "Make this my main display" in settings, and then two more displays to GPU B makes GPU A just send the rendered images to GPU B for those 2 monitors. It's the same story for those USB DisplayLink "graphics cards"/docking stations. So now, how to achieve that without any displays connected?
****************** [EDIT] ***************************
...anyway, made myself a custom context menu. Seems to be working for DirectX and Vulkan apps. OpenGL still managed by NVIDIA driver, unsure how to do this with mixed GPU brands or on system without NVIDIA gpu.
For anyone interested:
Registry file (.reg)
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\MsHybridContextMenu]
"MUIVerb"="Render DirectX\\Vulkan on"
"Icon"="CC:\Other\Icons\ico-3dgizmo.ico"
"SubCommands"="MsHybridRenderOnId0;MsHybridRenderOnId1;MsHybridRenderOnId2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\MsHybridRenderOnId0]
"MUIVerb"="[0] - Windows Preferred GPU"
"Icon"="C:\\Other\\Icons\\ico-windowslogo.ico"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\MsHybridRenderOnId0\command]
@="C:\\Other\\Scripts\\MsHybridSetGpu.bat \"%1\" 0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\MsHybridRenderOnId1]
"MUIVerb"="[1] - NVIDIA GeForce GTX TITAN"
"Icon"="C:\\Other\\Icons\\ico-nvidia.ico"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\MsHybridRenderOnId1\command]
@="C:\\Other\\Scripts\\MsHybridSetGpu.bat \"%1\" 1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\MsHybridRenderOnId2]
"MUIVerb"="[2] - NVIDIA GeForce GTX 970"
"Icon"="C:\\Other\\Icons\\ico-nvidia.ico"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\MsHybridRenderOnId2\command]
@="C:\\Other\\Scripts\\MsHybridSetGpu.bat \"%1\" 2"
MsHybridSetGpu.bat file:
Code:
REG ADD HKCU\SOFTWARE\Microsoft\DirectX\UserGpuPreferences\ /f /v %1 /t REG_SZ /d "GpuPreference=%~2;"
start "GPU Switch" %1
There also has to be a DWORD Value "EnableMsHybrid" for each GPU in registry in
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\000_\
where _
can be any number. Just open up the keys (folders) and look for the name of your GPU. Create the value and set it's data to 1 on first GPU and 2 on the second. Like I said in first post I have no idea if this is going to work for more than two GPUs. And yeah, you're doing this on your own risk, etc. etc.
Last edited: