Qt 6.4 windows movement/resizing behavior on DirectX
-
Hi,
We've started migrating our QtQuick/QML-based application from Qt 5.15.2 to QT 6.4, but in the process we noticed a significant performance downgrade, on Windows, when the app is using Qt6:
- if the selected graphics api is DirectX (the default option), the application's windows(QQuickViews) movement and resizing are jerky/stuttering.
- memory usage is higherThis movement/resizing behavior is reproducible also on simple QT example apps, like
..\Examples\Qt-6.4.0\quickcontrols2\texteditor
..\Examples\Qt-6.4.0\demos\clocksWhen forcing the app to use OpenGL, using QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi), everything works smooth, as expected.
Is there anything that can be done to improve performance on DirectX? Am I missing something?
System Information
Operating System: Windows 10 Enterprise 64-bit (10.0, Build 19043) (19041.vb_release.191206-1406)
System Manufacturer: LENOVO
System Model: 21AAS0T500
Processor: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 CPUs), ~2.5GHz
Memory: 32768MB RAM
Available OS Memory: 32472MB RAM
DirectX Version: DirectX 12Display Devices
Card name: Intel(R) UHD Graphics
Manufacturer: Intel Corporation
Chip type: Intel(R) UHD Graphics Family
Display Memory: 16363 MB
Dedicated Memory: 128 MB
Shared Memory: 16235 MB
Driver File Version: 31.00.0101.3358 (English)
Driver Version: 31.0.101.3358
Detachable GPU: No
Hybrid Graphics GPU: Integrated
Device Identifier: {D7B78E66-D920-11CF-0479-BC02AEC2D235}
Vendor ID: 0x8086
Device ID: 0x9A60Card name: NVIDIA T600 Laptop GPU
Manufacturer: NVIDIA
Chip type: NVIDIA T600 Laptop GPU
Display Memory: 20200 MB
Dedicated Memory: 3965 MB
Shared Memory: 16235 MB
Driver File Version: 31.00.0015.1766 (English)
Driver Version: 31.0.15.1766
Detachable GPU: No
Hybrid Graphics GPU: Discrete
Device Identifier: Unknown
Vendor ID: 0x10DE
Device ID: 0x1FBAScene graph information via the QSG_INFO environment variable
Qt 6.4.0 MSVC2019 64bit
qt.scenegraph.general: Using QRhi with backend D3D11
Graphics API debug/validation layers: 0
QRhi profiling and debug markers: 0
Shader/pipeline cache collection: 0
qt.scenegraph.general: threaded render loop
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
qt.rhi.general: FLIP_* swapchain supported = true, ALLOW_TEARING supported = true
qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
qt.rhi.general: using this adapter
qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
qt.scenegraph.general: rhi texture atlas dimensions: 1024x1024 -
@AlexMax Is this a pure QML application (based on QQuickView) or a Widget application with QQuickWidget?
In general,
- See if there are driver updates
- You can choose to use the nVidia card, e.g. through Windows "Graphics Settings" -> "Graphics performance preference" by application
-
@Asperamanca Our app doesn't use QQuickWidgets, main app windows are QQuickViews loading qml content.
The behavior was noticed also on simple QML sample apps that are provided with the QT 6.4 SDK.Re. 1. the drivers are up to date; the problem reproduces also on other hardware configurations
Re. 2. we used QT_D3D_ADAPTER_INDEX env var to force the app to use nVidia adaptor, but nothing changed.Thanks.
-
@AlexMax said in Qt 6.4 windows movement/resizing behavior on DirectX:
we used QT_D3D_ADAPTER_INDEX env var to force the app to use nVidia adaptor, but nothing changed
And the qt.rhi.general output confirmed it was used?
In general, Qt5 used OpenGL, so setting that is probably closest to previous behavior. I have also experienced flickering with Direct3D on occasion, but haven't found the causes of it.
-
@Asperamanca said in Qt 6.4 windows movement/resizing behavior on DirectX:
And the qt.rhi.general output confirmed it was used?
Yes.
Using ..\Examples\Qt-6.4.0\demos\clocks app, for instance, the main looks like this:
int main(int argc, char *argv[]) { qputenv("QSG_INFO", "1"); //qputenv("QT_D3D_ADAPTER_INDEX", "1"); QCoreApplication::setOrganizationName("QtExamples"); QGuiApplication app(argc, argv); //QQuickWindow::setGraphicsApi(QSGRendererInterface::Direct3D11); //QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL); qDebug() << "Current Graphics API =" << QQuickWindow::graphicsApi(); QQuickView view; view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit); view.setSource(QUrl("qrc:/demos/clocks/clocks.qml")); if (view.status() == QQuickView::Error) return -1; view.setResizeMode(QQuickView::SizeRootObjectToView); view.show(); return app.exec(); }
Using Qt 6.4.0 MSVC2019 64bit
Build configuration: Releaseqt.rhi.general output looks like this:
09:51:10: Starting C:/Qt/Qt6.4/Examples/Qt-6.4.0/demos/build-clocks-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/clocks.exe...
qt.scenegraph.general: Using QRhi with backend D3D11
Graphics API debug/validation layers: 0
QRhi profiling and debug markers: 0
Shader/pipeline cache collection: 0
Current Graphics API = 4
qt.scenegraph.general: threaded render loop
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
qt.rhi.general: FLIP_ swapchain supported = true, ALLOW_TEARING supported = true
qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
qt.rhi.general: using this adapter
qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
qt.scenegraph.general: rhi texture atlas dimensions: 1024x512
qt.scenegraph.general: animation driver switched to timer mode
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: animation driver switched to vsync mode
qt.scenegraph.general: animation driver switched to timer mode
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: animation driver switched to vsync mode
qt.scenegraph.general: animation driver switched to timer mode
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: animation driver switched to vsync mode*If I uncomment this line:
//qputenv("QT_D3D_ADAPTER_INDEX", "1");
the output is this:
Starting C:/Qt/Qt6.4/Examples/Qt-6.4.0/demos/build-clocks-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/clocks.exe...
qt.scenegraph.general: Using QRhi with backend D3D11
Graphics API debug/validation layers: 0
QRhi profiling and debug markers: 0
Shader/pipeline cache collection: 0
Current Graphics API = 4
qt.scenegraph.general: threaded render loop
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
qt.rhi.general: FLIP_ swapchain supported = true, ALLOW_TEARING supported = true
qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
qt.rhi.general: using this adapter
qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
qt.scenegraph.general: rhi texture atlas dimensions: 1024x512
qt.scenegraph.general: animation driver switched to timer mode
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: animation driver switched to vsync mode
qt.scenegraph.general: animation driver switched to timer mode
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: animation driver switched to vsync mode* -
Setting env var QT_D3D_NO_FLIP=1 (source:https://bugreports.qt.io/browse/QTBUG-99637) will fix the movement/resizing issues for Qt6.4.0. But this is a workaround, not a solution.
I noticed QT_D3D_NO_FLIP was removed in Qt6.5 LTS and the issues are still present.
Has anyone found a proper solution for this? -
@AlexMax
The issues is marked fixed in 6.3 and 6.4, so it it still persists in 6.5, that would probably warrant a new issue, linking to the old one. Or is it captured by linked and still-open https://bugreports.qt.io/browse/QTBUG-99602?