#OpenXR - choose which GPU to use

38 messages · Page 1 of 1 (latest)

grizzled garden
#

Is there any way to select which GPU should be used by OpenXR (with underlying DirectX 11)? The only related method I have found is xrGetD3D11GraphicsRequirementsKHR. But it returns a single struct with single GPU that should be used (LUID od device).

We are using Holographic Remoting (remote rendering to HoloLens) extension of OpenXR which means there is not connected any AR/VR headset. Our program runs on laptop with integrated Intel GPU and dedicated NVidia. OpenXR seems to always automatically choose NVidia GPU. We need to select integrated Intel one for some debug purposes and possible later choose between multiple dedicated GPUs. Is this possible somehow?

rancid moat
#

You can export symbols to request that your binary doesn't default to using the high powered GPU. #directx message

#

But the modern way to access this is via Win CP.
System > Display > Graphics > change binary in list from "Let Windows decide" to "power saving". This should ignore the heuristics or exported symbols and give you the iGPU by default (very handy in legacy APIs where you can't explicitly iterate a full list of GPU options and pick which one you want to send work to).
Before Win10 2018 patch, this used to be managed in the dGPU vendor CP (and you can still see bits of it in eg nVidia's CP) but the official location to manage this setting is not under the Windows CP.

grizzled garden
#

I have looked into that. It should help in some cases. But it still does not help in case of having multiple dedicated GPUs.

placid escarp
#

I suppose you could try to enumerate all GPUs and run some microbenchmark.

grizzled garden
#

I need a way to select which of multiple dedicated GPUs should OpenXR use. The only related method is xrGetD3D11GraphicsRequirements but that returns a single GPU (LUID of it) that should be used in DirectX API. Enumerating GPUs using DirectX and then choosing different one than the one returned from xrGetD3D11GraphicsRequirements causes OpenXR to throw exception.

placid escarp
#

So you must use the adapter that OpenXR runtime has chosen for you

#

If you are lucky, perhaps holo has some way to set the adapter

#

If not.. perhaps there is way to do rendering in one adapter and send the result to another? I dont know D3D well enough though

grizzled garden
#

I see. It really sucks that OpenXR does not provide way to choose which GPU to use. This is standard in graphics API for quite some time. Using one adapter for rendering and other for showing result would work but that means copy and synchronisation causing unnecessary performance hit. And performance, especially frame latency, is extremely important in remote rendering for AR/VR which I am trying to do.

rancid moat
#

Does the only adaptor that OpenXR pick when using this default interface... always pick the GPU that the VR headset is physically connected to?

#

As you mention, there is only one "right" GPU to pick, for minimal latency & it depends how the hardware routes the signal from the various GPUs to the headset (or where the direct connection is, when it comes to desktop dGPUs).

grizzled garden
#

I am using Holographic Remoting (extension of OpenXR) for remote rendering to HoloLens. There is no headset physically connected to PC.

rancid moat
#

But if you were to physically connect a VR headset, would OpenXR be auto-selecting the physical connection (this would explain the API choice to not let you pick a different GPU & narrow down the issue to the Holographic Remoting extension, not the OpenXR API design).

grizzled garden
#

Yes, that is a good point. It makes sense that way. However I would still thought OpenXR API was designed more broadly. Like Vulkan, for example.

placid escarp
#

This is not really an issue in OpenXR, this feels like the issue is specific to this runtime

#

Did you check D3D12 / vulkan, how they work with OpenXR?

grizzled garden
#

Unfortunately we are stuck with D3D11 due to compatibility with other parts of platform we use.

placid escarp
grizzled garden
#

OpenXR natively supports all major graphics API.

placid escarp
#

Not all runtimes do

grizzled garden
#

Oh, I see. Good to know. Thanks.

placid escarp
#

API support is is extensions

grizzled garden
#

Also, I will try to forward issue with selecting GPU in OpenXR directly to Microsoft since they are the ones responsible for Holographic Remoting extension and their custom OpenXR runtime for this.

placid escarp
#

I think that is a good idea.

#

I agree it is a limitation that runtime chooses the adapter and does not let user to choose it.

#

Locally when you have headset physically connected to an adapter, this is understandable

#

But remotely, runtime probably should either choose the most powerful adapter, and/or somehow let user choose

#

Current graphics API extensions, at least for D3D, don't seem to allow user to make the choice

grizzled garden
placid escarp
#

I've had two headsets connected but they were from different vendors so different runtime - Choosing runtime chose the headset

grizzled garden
#

Oh, I see.

placid escarp
#

The remote use case is a likely candidate for a future extension

#

You can also ask Khronos about it

grizzled garden
#

Good idea! Thanks.

placid escarp
#

They might already be aware of this issue, and there eventually will be an extension to handle this, I guesstimate

grizzled garden
#

I wish. That would be great. I hope somebody will reply to me on Khronos' Discord server because on the first sight it looks rather empty.

placid escarp
#

they have slack too, I didn't realize they have discord as well