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: 2I'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
QQuickWindowobject. One of the related functions isQQuickWindow::setGraphicsDevice, which is not feasible since it takes an already existingVkPhysicalDeviceobject. AVkPhysicalDeviceobject can only be created after showing aQQuickWindowobject.Meanwhile the widget class
QVulkanWindowgives us a convenient functionQVulkanWindow::setPhysicalDeviceIndexfor doing this.Perhaps the setting up with class
QQuickRenderControlis 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.