Deploying Qt5 on Windows without Hardware Acceleration - windows

Qt5 can use the OpenGL driver or the DirectX Driver by using ANGLE. As we cannot depend on an installed OpenGL driver, we need to use the ANGLE backend. Unfortunately, this doesn't solve all deployment problems especially on Windows virtual machines without hardware acceleration. On these systems, we're getting an error message saying that the creation of an OpenGL context failed.
Screenshot: Failed to create OpenGL context for format QSurfaceFormat
We're deploying all required libraries (libEGL.dll libGLESv2.dll libeay32.dll msvcp110.dll msvcr110.dll d3dcompiler_46.dll) but we're still getting this error message.
How do you deploy a QML application that needs to run on end user machines without OpenGL driver and on (virtual) machines without Direct3D Acceleration?
There is a page on the Qt wiki mentioning this problem, but that's not very helpful for solving it.
Update for Qt 5.4.0:
My findings so far are:
Setting QT_ANGLE_PLATFORM=warp -> creates a windows without content.
Setting QT_ANGLE_PLATFORM=d3d9 -> same error dialog, as expected.
Setting QT_ANGLE_PLATFORM=d3d11 -> same error dialog, as expected.
Setting QT_OPENGL=desktop -> same as QT_ANGLE_PLATFORM=warp.
Setting QT_OPENGL=angle -> same error dialog, as expected.
Setting QT_OPENGL=software + opengl32sw.dll (mesa for windows) -> unpredictable: May run, may crash, may show the error dialog.
Update for Qt Quick 2D Renderer
Although, Mesa seems to be a partial solution, the configration seems to be very crash often in Qt 5.4.0 .
Another fallback could be the Qt Quick 2D Renderer, but unfortunately this crashes too.
Copying softwarecontext.dll into /scenegraph + Setting QMLSCENE_DEVICE=softwarecontext -> crash
Update after some user experience:
Angle
Has some render bugs on some systems
Does not work reliable on all systems
Angle with Warp
Not reliable
Desktop OpenGL
The default implements OpenGL 1.1, which is too old.
Not reliable, even if the OpenGL version is ok.
Has render bugs, if used by Qt
QtQuick2dRenderer
Has some major render issues
Crashes, Freezes
Works on systems without HW acceleration
Mesa OpenGL Backend
Seems to be quite reliable at the moment
quite slow in general, very slow on some systems.
Heavy Deployment weight
Conclusion: there is still no real solution for these systems
Update for Qt 5.5
Anno 2015: Broken graphics drives are still broken.
My conclusion for the moment is:
Use QtQuick2dRenderer if possible.
Use Mesa backend otherwise.
Skip Angle, skip Desktop OpenGL, skip Warp.

QT 5 has huge compatibility issue with opengl on some hardware configurations
Combination of Intel HD3000 driver and Nvidia/ATI card won't work on Windows 10.
https://bugreports.qt.io/browse/QTBUG-42240
Intel drops support for this card but their drivers has bug that leads to crash.
You cannot rely on hardware opengl if you want to support customers with HD3000.

Under Windows, opengl32.dll is the default OpenGL driver. It implements OpenGL 1.1 (really old version).
ANGLE has a baseline of OpenGL ES 2.0 and needs DirectX 9/11 installed to map the calls into.
So if you got a video card that doesn't have an OpenGL driver installed, an OpenGL driver less than 2.0, and/or DirectX 9/11 not installed, your app is not going to work.
In regards to virtualization and 3D acceleration, these maybe worth a read:
Why does Qt Creator 3.0.0 Welcome Mode not work in VM?
https://bugreports.qt.io/browse/QTBUG-34964
Also, if you run a multi monitor Windows environment under VirtualBox, 3d acceleration will be disabled.

I re-checked this to see if these problems have been fixed by the latest release of QT 5.12.2, but no they have not. The function described in the QT wiki entry OP referenced
https://wiki.qt.io/Qt_5_on_Windows_ANGLE_and_OpenGL sounds good but in practice it simply doesn't work.
I conclude avoid OpenGL on QT in any form. It's just too unreliable.

Related

OpenGl without compatible graphics card?

Basically I have a windows system that does not have a graphics card, and I am trying to execute a .jar file in cmd, which gives the following output:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\shattered>java -jar test.jar
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: OpenGL is not supported by the video driver.
I am only somewhat tech literate but the takeaway I got from that was that I needed to get OpenGl. So I did some research and found a few mentions of OpenGl software mode or something but I have no idea of how to go about doing so. Any help would be greatly appreciated, cheers!
And before it is mentioned, I have tried updating the video driver.
First on the "what":
OpenGL is a application programming interface (API) between the graphics facilities of the operating system (which in broad term covers everything between putting windows to the screen down to placing single pixels) and individual programs. The main purpose of OpenGL is providing access to accelerated graphics infrastructure optimized for rasterizing graphics primitives most suitable for 3D image generation.
Now to the "how":
The typical OpenGL implementation ships as part of the drivers of 3D graphics accelerator processors (GPUs). However since (a very old) version of OpenGL, namely OpenGL-1.1, has been specified as part of the Win32 API every version of Windows since Windows 95B and Windows NT-4 includes a fallback software implementation that can be used in case no accelerated OpenGL version is available. However if any version beyond OpenGL-1.1 is required this fallback does not provide it.
However you can substitute the standard OpenGL interface with an advanced software rasterizer implementation: The Mesa project provides a version of their software rasterizer that provides even modern core profile OpenGL. The usual recommendation is to place these substitute opengl32.dll besides the .exe file of the program that requires it; in fact on modern Windows systems with system file protection it's actually impossible to replace the original DLLs without jumping a few hoops. The MSys2 project offers prebuilt versions of substitute DLLs.
Current (as of writing this):
64 Bit version: https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/mingw-w64-x86_64-mesa-17.0.0-1-any.pkg.tar.xz/download
32 Bit version: https://sourceforge.net/projects/msys2/files/REPOS/MINGW/i686/mingw-w64-i686-mesa-17.0.0-1-any.pkg.tar.xz/download
XZ archives can be unpacked with 7-zip.
Default VGA/VESA driver is also used for gfx card without propper driver. Such cards usually emulate EGA/VGA/VESA until initialized so windows default driver works for them.
So during boot freeze the screen and look at the PID/VID table of installed devices. from that numbers you can detect which gfx card you really have and look for drivers.
In rare case you really got just EGA/VGA/VESA (which I doubt) in the old MS-DOS times there were OpenGL software drivers even for those. What you need is find OpebGL DLL for your platform like (opengl32.dll) and place it either directly to your executable or into known path like system32 ... In such case you should get at least OpenGL 1.0 support in SW rendering mode
btw if my memory serves well in the old times of win3.11 and win9x this OpenGL32.dll was a part of windows instalation and we got the OpenGL screen savers running on VESA cards natively.

Debugging OpenGL ES 2.0 game that runs in Windows through PowerVR emulation

I have small cross platform engine that runs my OpenGL ES 2.0 games on Android and on Windows. To run it on Windows I am using PowerVR emulator (just libraries linked to the project). It all works well.
Now I would like to debug it and inspect in any OpenGL debugger. I tried Intel GPA, AMD CodeXL, gDebugger, glslDevil. But non of them were able to do it. In case of Intel GPA it did not find the running game. In other cases it started the game but failed to pause it or do anything later.
I do not know whether it is because it is OpenGL ES instead of OpenGL. But the PowerVR emulation must work like translating OpenGL ES to OpenGL, I think?
My questions are:
Is there any (utility) way how to debug OpenGL ES 2.0 programs on Windows?
Or is there any better emulation library than PowerVR that will force the app look like OpenGL for other tools (instead of OpenGL ES)?
I am doing all this as none of debuggers work for me on Android device. I am developing with Samsung Galaxy Tab (which is Tegra GPU), but Nvida's PerfHUD ES does not currently support it (and I also do not meet Android 4.0 or higher having only 3.1)
Is there any way how to debug OpenGL ES on Android device that has Android version 3.1 and it is Samsung Galaxy Tab device?
Thanx
You're correct - PVRVFrame translates OpenGL ES calls into host OpenGL calls. This is why the likes of gDEBugger will capture the OpenGL API calls made by the emulator rather than the calls you actually submitted.
The PowerVR SDK includes an OpenGL ES/EGL API recording tool called PVRTrace that has all of the functionality you're looking for.
The PVRTrace recording libraries can be used to record applications using PVRVFrame on Windows and Linux. The SDK also includes recording libraries for Android and Linux devices.
PVRTraceGUI (analysis tool for Windows, OSX & Linux) can be used to review and inspect the data you've recorded. It also has an Image Analysis widget that allows you to step through the draw calls in your recording & some other handy features, such as a Pixel Analysis pie chart that highlights the most costly fragment shaders in your render so you know where to focus shader optimisation.
There's also a PVRTrace standalone playback tool that allows you to replay your recordings on any of the supported OS's (inc. Windows & Android).
You can find an overview of the tool on the Imagination website here & can download PVRTrace through the PowerVR SDK installer, available here
I routinely debug OpenGL ES on Windows using the PowerVR VFrame translator, which converts OpenGL ES calls to OpenGL, as you said. I think it's the best solution. VFrame has some step and tracing features, but mostly I am using the debugging features of MSVC++.
If you are using GLSurfaceView on android, it has an OpenGL ES tracing feature too. I also recommend using an X86 AVD rather than ARM or trusting the drivers on any one device. This article explains in detail:
http://software.intel.com/en-us/articles/porting-opengl-games-to-android-on-intel-atom-processors-part-1

OpenGL fails to render on windows 8

I am encountering an issue where nothing is rendered when running a simple OpenGL application through VS 2012 on Windows 8.
I had a little debug renderer I was using to prototype some projects and had it up and running on Windows 7 using VS 2012 Express Edition.
I upgraded to Windows 8, and cloned the git repository with my work on. After installing the latest drivers and installing VS 2012, I ran my application, but nothing displayed, all I get is the screen clear colour. I was getting an exception before but that's because I didn't have the right drivers so when calling glGetIntegerv(GL_MAJOR_VERSION,...) I'd get -1 as OpenGL wasn't set up correctly. It is initialised correctly now and when stepping through, it looks like everything is working fine, the only problem is I'm not seeing anything.
To make sure it wasn't just my code I downloaded some of the Swiftless OpenGL examples and got the exact same thing. My application was using OpenGL 3.2 and no deprecated functionality. My hardware can support up to 3.3, and if it is of any use I am running Window 8 through Boot Camp on a Macbook air.
I have been bashing my head against a wall for the last couple of days trying to solve this but I'm not having much luck, I thought I'd throw it out there to see if anyone has had a similar problem, I'd be really grateful if anyone can offer any information. If someone with Windows 8 could download and build a simple OpenGL application though VS just to see if they can get something up on screen that would be interesting!
Do you use the good old and deprecated fixed function pipeline, namely immediate mode draw calls like glBegin(), glVertex*() and glEnd()? If so, try to draw your stuff using vertex arrays. Even if this doesn't help in your specific situation, immediate mode draw calls should be avoided at all cost to make the code forward compatible. The OpenGL 3.x core profile doesn't contain these old API functions anymore. I had also a blank screen on my new Win 7 notebook (OpenGL 3.3) because of some stale immediate mode draw calls (FTGL).
EDIT:
For independent GL debugging, I recommend this:
http://www.gremedy.com/
This program allows you to pause the execution and investigate buffer contents, shader programs and more.
After installing the latest drivers
Where did you get the drivers from? Only drivers you download directly from the GPU vendor's website ship with proper OpenGL support. The drivers automatically installed by Windows have only poor OpenGL support.
opengl support is not available for windows 8.their are still techniques to use it on windows its better to search on google coz i tried for minecraft game or u can check here too

QtOpenGL and MacOS X -- Software rendering?

I'm developing a cross-platform application and am not very familiar with the Mac platform. I use Qt for the GUI. I use a QGLWidget to make sure the drawing (with QPainter) is done in OpenGL.
My project built fine in XCode and runs. However, drawing is slow as hell, in situations where on Windows and Linux machines speed is not an issue. The Macbook has an Nvidia GPU, whereas the Windows machine has only onboard intel graphics.
When I look at the binary, it seems that while linking to QtOpenGL lib, it does not explicitely link to the GL lib itself.
How can I test if hardware acceleration is working or software fallback rendering is doing the job?
Shouldn't my binary link to the GL lib, or is this hidden as being a recursive dependency?
The best way to see what OpenGL implementation is using is to print the value of glGetString(GL_VENDOR) and glGetString(GL_RENDERER), this should help pinpoint the problem.

Easiest way to run a simple GLES/EGL/OpenVG app on a PC?

I thought this should be easy, but... geesh! A vendor gave me a fairly simple demo program meant to showcase some trivial icon animations. The target platform is an embedded system (MX51) with accelerated OpenGL ES 2.0/OpenVG and EGL support.
Unfortunately, the demo also has an annoying dependency on a few Qt utility classes (e.g., QImage). If not for this dependency, I would compile/run the thing on the target. But I don't relish the thought of cross-compiling Qt just to run this little demo---even if there were enough room for it on the embedded board.
I hoped I might be able to run the app on a standard(ish) Ubuntu 10.04 VM, and started following these directions to make it happen. And I actually managed---like, 10 hours later---to compile everything and get a runnable binary of the demo program. However, when I run it, I see the following error:
eglCreateWindowSurface: egl error "EGL_BAD_CONFIG" (0x3005)
Sigh. Not what I wanted to see after all that effort. This seems way more difficult than it should be.
Is the embedded GL landscape really such a ghetto that I have to run even trivial programs on the target using some vendor-supplied BSP? Judging from the lack of responses to this guy's question, I'm thinking the answer might be yes. But I don't even care about acceleration (yet). I just want to run the stupidest of OpenGL ES 2/OpenVG programs on a desktop PC and get an idea of how it looks. (It doesn't matter to me whether the PC is running Linux or Windows.) How do people do this sort of thing?
There are several OpenGL ES 2.0 emulators, such as:
For ARM Mali GPUs
For PowerVR GPUs
Also very recently, AMD has posted drivers that expose OpenGL ES 2.0 on desktop.
More recently, OpenGL 4.1 exposes the GL_ARB_ES2_compatibility extension, which makes OpenGL 4.1 drivers GL ES 2.0 compatible.
For OpenVG, you can use AmanithVG GLE.
Qualcomm's OpenGL ES emulator includes OpenVG support. You can download it from http://developer.qualcomm.com

Resources