Can't run minimal Qt Quick WebEngine example with hardware rendering
I'm starting a new project with Qt, and part of that project will involve using QtWebEngine. I'm new to Qt, so I'm trying to fire up an example to tinker with - the example being "WebEngine Qt Quick Minimal Example". When running the example in debug mode with the on a fresh installation of Qt with the latest versions of everything (Qt Creator 4.6.0, Qt 5.10.1/Qt 5.11, and MSVC2017 64bit), the application outputs the following:
Starting C:\Qt\Examples\Qt-5.11.0\webengine\build-minimal-Desktop_Qt_5_11_0_MSVC2017_64bit-Debug\debug\minimal.exe... QML debugging is enabled. Only use this in a safe environment. [2316:7748:0329/141148.989:ERROR:gl_surface_wgl.cc(372)] wglCreatePbufferARB not available. [2316:7748:0329/141148.989:ERROR:gl_surface_wgl.cc(372)] wglCreatePbufferARB not available. [2316:7748:0329/141148.989:ERROR:gl_surface_qt.cpp(751)] Requested OpenGL implementation is not supported. Implementation: 1 [2316:7748:0329/141148.989:ERROR:gl_surface_qt.cpp(751)] Requested OpenGL implementation is not supported. Implementation: 1 ASSERT failure in Q_UNREACHABLE(): "Q_UNREACHABLE was reached", file C:/Users/qt/work/qt/qtwebengine/src/core/gl_surface_qt.cpp, line 752
And along with that, the following error message pops up:
However, if I tell the application to use software rendering via
QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);, then the application works and displays the webpage (as expected). I'm a bit stuck as I can't imagine my GPUs don't support whatever OpenGL implementation it's looking for (this all takes place on a Windows 10 Pro 1709 machine that has two NVIDIA GTX 1080s - the error occurs regardless of the cards being in SLI mode or not). After clicking that Ignore button twice (I assume it tries once per card), it displays the webpage, but with software rendering enabled (even if I don't set that attribute). In release mode, it simply crashes the moment it starts. Can anyone shed some light on what I should look into to figure out why WebEngine just won't work with hardware rendering for me?
honestly i don't have any idea what goes wrong. But here are just my few cents:
Try adding some parameters (which are automatically picked up by QtWebEngine).
myQtApp.exe --use-angle=gl --ignore-gpu-blacklist --enable-gpu-rasterization
Just to check if it makes any difference.
--use-angle=gl --ignore-gpu-blacklist --enable-gpu-rasterization
Gave that a shot by inputting those parameters in Projects -> Desktop Qt 5.11.0 MSVC2017 64bit -> Run -> Command line arguments, still no luck. Additionally, I tried deploying the application to see if it was Qt Creator causing issues using this
windeployqt --qmldir C:\Qt\Examples\Qt-5.11.0\webengine\minimal C:\Qt\Examples\Qt-5.11.0\webengine\build-minimal-Desktop_Qt_5_11_0_MSVC2017_64bit-Debug\debug
And it still threw the same error, with or without those additional arguments. On top of that, I installed Qt on a Ubuntu VM and ran the same example, and received a similar error saying that the same function isn't available.
Figured I'd update this - this thread can now be closed!
Not sure what I did to fix it. I completely removed my old Qt folder via the maintenance tool, installed 5.10.1 with only MSVC 2017 support and QtWebEngine support checked (as opposed to having everything selected)... and it works. No errors about not being able to create a pixel buffer, and now I can load a YouTube video and watch it at a stable 60 FPS at 4K (and an almost stable 60 FPS @ 8K, seemingly only dropping frames every few seconds as it sends video data to the GPU (I imagine)! Not far behind Chrome itself which will play the same video without those hiccups, and very far beyond the needs of my project).
@Kevin_P thanks for your feedback. I'll close this topic for you, next time you can do yourself with the button 'Topic Tools'. Thanks