Cannot select from multiple available GPUs used by QQuickWindow.
-
There are no appropriate functions that can set the GPU used by
QQuickWindow/QQuickView
.I'm using qt6.3 on windows11. I get two GPUs on my laptop:
Device name: AMD Radeon(TM) Graphics Device type: 1 Device name: NVIDIA GeForce RTX 3060 Laptop GPU Device type: 2
I'm trying to use the vulkan api to render the qml scene. But I cannot set the GPU I want to use before showing a
QQuickWindow
object. One of the related functions isQQuickWindow::setGraphicsDevice
, which is not feasible since it takes an already existingVkPhysicalDevice
object. AVkPhysicalDevice
object can only be created after showing aQQuickWindow
object.Meanwhile the widget class
QVulkanWindow
gives us a convenient functionQVulkanWindow::setPhysicalDeviceIndex
for doing this.Perhaps the setting up with class
QQuickRenderControl
is possible for doing this, but there are too much stuff to take care of for merely selecting a GPU device. I thought it should be a common demand literally. -
I would post this in https://lists.qt-project.org/listinfo/interest if I were you.