I compiled glxgears.c demo code by linking it with libGL.so provided by mesa.
This compilation is for ubuntu guest in virtual box and host is windows 7.
I am running my demo code in ubuntu, during run time it is accessing VBoxOGL.so provided by virtual box guest additions and using 3D hardware acceleration of host.
If I rename VBoxOGL.so to some other name my demo code is not using hardware acceleration but uses software rendering.
Can you tell me how my demo code is connected to VBoxOGL.so.
I need the flow from democode->libGL.so->how ? ->VBoxOGL.so->h/w. As these 2 libraries are not linked together during compilation am not sure how libGL calls are directed to VBoxOGL.so.
Help me to understand the flow and which library or module is doing this redirection.
I don't know the internals of Virtual Box, but my best guess would be that they either LD_PRELOAD that .so instead of libGL.so, or that it's been implemented as a Mesa state tracker and acts on the backside of Mesa as other DRI2 based GPU drivers do.
Related
I have just upgraded my project to use Qt 5.7, on Mac I am able to load the html pages using Qt Webengine but on Window 7, the pages are not displayed, instead a black screen is shown.
I have also compiled simple browser example and it too only shows a black screen.
I am using the visual studio 2013 build of Qt 5.7
Does anyone know why it is not displaying the pages.
Does Qt 5.7 need any third party libraries for it render correctly on Windows.
We had a similar problem, whenever we started an application with a QWebEngineView it would only show a black screen or even crash on another machine. The problems occured due to wrong versions of api-ms-*.dlls and d3dcompiler_47.dll we had packaged with our app.
We found the correct versions on our developer machine with installed Windows SDK under "C:\Program Files (x86)\Windows Kits\10\Redist".
On a side note: We found that deployement of QWebEngine under windows is quite a hassle.. you also need to include "qtwebengine_locales" from qtbase\translations and "resources" from qtbase as well as "QtWebEngineProcess.exe" from qtbase\bin.
A thing that helped tracking down the problem, was putting "CONFIG += console" in the pro-file. That way the console output with relevant error information is shown on deployement targets.
With help of this comment from peppe
One can use temporary workaround with graphic drivers not supporting DirectX11 but supporting DirectX9
As said here
https://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers
Graphics Drivers
For Qt Quick 2 to work, a graphics driver that provides OpenGL 2.1 or higher is required. The default driver from Windows is OpenGL 1.1. Qt includes a version of the ANGLE project which is included from the Windows Qt installers. ANGLE implements the OpenGL ES 2.0 API on top of DirectX 11 or DirectX 9. ANGLE requires that the DirectX SDK is installed when building Qt.
ANGLE chooses the render backend depending on availability. DirectX 11 is usually preferable. However, some graphics cards may not fully support it. For these cases, the environment variable QT_ANGLE_PLATFORM (introduced in Qt 5.4) can be used to control the render backend. Possible values are d3d11, d3d9 and warp.
So this may help
set QT_ANGLE_PLATFORM=d3d9
Or use mesa with
https://www.mesa3d.org/llvmpipe.html
Qt::AA_UseSoftwareOpenGL is special in the sense that it will try to load an OpenGL implementation with a non-standard name. The default name is opengl32sw.dll. This allows shipping a software-only OpenGL implementation, for example a build of Mesa with llvmpipe, under this name. If necessary, the filename can be overridden by setting the QT_OPENGL_DLL environment variable.
Edit 1:
One can use fallback method for one-time login to Dropbox Windows client ( made with QT framework ) for example
Dynamically Loading Graphics Drivers
In addition to the build time configuration, Qt supports choosing and loading the OpenGL implementation at runtime. To use this mode, pass -opengl dynamic to the configure script.
Note: As of Qt 5.5 this is the configuration used by the official, pre-built binary packages of Qt. It is strongly recommended to use it also in custom builds, especially for Qt binaries that are deployed alongside applications.
...
This configuration is the most flexible because no dependencies or assumptions are hardcoded about the OpenGL implementation during build time. It allows robust application deployment. When a given environment fails to provide a proper OpenGL 2.0 implementation, it will fall back automatically to ANGLE. This fallback will be completely transparent to the application, and will allow Qt Quick or other OpenGL code to function by translating to Direct3D. Such a fallback could, for example, take place on a Windows 7 PC with no additional graphics drivers installed. On other machines, where there is sufficient OpenGL support, the normal desktop OpenGL drivers will be used. Additionally, pure software-based OpenGL implementations may be available as additional fallbacks in the future, allowing running Qt Quick applications without a GPU.
When configured with -opengl dynamic, neither Qt nor the applications built using qmake will link to the opengl32 (standard desktop OpenGL) or QtANGLE libraries. Instead, the appropriate library is chosen at runtime. By default, Qt will determine whether the system's opengl32.dll provides OpenGL 2 functions. If these are present, opengl32.dll is used, otherwise the ANGLE libraries (libEGL.dll and libGLESv2.dll) will be used. In case the ANGLE libraries are missing or initialization fails for some reason, an additional fallback is attempted by trying to load opengl32sw.dll. See below for details.
Such a fallback could, for example, take place on a Windows 7 PC with
no additional graphics drivers installed.
To emulate this conditions one can use RDP session with mandatory 8 bpp to Windows machine
I tried to install cuda toolkit without display driver in CentOS 6. It gets installed properly. I was able to compile but it is compiling without performing any operation and I get garbage values in array addition. For cudaGetDeviceCount(&count) I am getting value as "o" which means I don't have any card on my machine.
You can install the CUDA toolkit without installing the driver.
You can then compile CUDA codes that use the runtime API.
You will not be able to run those codes unless you have a proper CUDA driver and GPU installed in the machine, however.
Codes that depend on the driver API will also not be compilable in this configuration, on older CUDA toolkits, without additional work. Newer CUDA toolkits provide stub libraries for driver libraries, which can be linked against.
This answer covers the method to install the CUDA toolkit without the driver.
If you want just run the codes and profiling the performance and other parameters, it would be helpful if you install GPGPU-sim simulator. It doesn't need any graphic card on your machine.
I have successfully installed Vbox guest additions for Ubuntu guest.
The guest additions installs set of libraries. VboxOGL.so is one among them
My observation:
1. The VBoxOGL.so available on 32-bit Ubuntu guest exports OpenGL calls (e.g. glEnable etc)
2. The VBoxOGL.so available on 64-bit Ubuntu guest exports glx calls and have no OpenGL calls.
Why the above difference?
My intension is to use the OpenGL interfaces from VBoxOGL.so to run OpenGL demos. Is this ever possible?
With only guest additions intalled, can i achieve hardware accelerated graphics for OpenGL demos? How to confirm the same?
I'm currently porting an open-source OpenGL game to OpenGL ES. The target device runs Linux and has a relatively weak CPU (ARM11 family, with FPU). It has an OpenGL ES accelerator but not an OpenGL one.
Initially I want to get the existing OpenGL-GLX-X11 implementation to run, using an accelerated OpenGL instance on another Linux machine - for example, an Athlon X2 with a Radeon X1650 Pro. This will help to verify that there are no serious CPU bottlenecks that need to be sorted out at a high level.
I have managed to set up SSH forwarding of the X11 connection. The glxinfo and glxgears programs run, but the latter has very poor performance (8fps) compared to a locally running glxgears (60fps with vsync). The glxinfo report stated that Direct Rendering is being used, which tells me that the local (to the ARM device) software renderer is being used.
What I want to happen is for OpenGL commands to be sent to the Athlon X2 machine and accelerated using the Radeon. I believe I need to turn on Indirect Rendering for this. However, setting LIBGL_ALWAYS_INDIRECT=1 does not change anything. For example:
arm$ LIBGL_ALWAYS_INDIRECT=1 glxinfo | fgrep rendering
direct rendering: Yes
arm$
The ARM device is running Gentoo Linux. What is the best way to force what I want to happen?
The glxinfo and glxgears programs run, but the latter has very poor performance (8fps) compared to a locally running glxgears (60fps with vsync). The glxinfo report stated that Direct Rendering is being used, which tells me that the local (to the ARM device) software renderer is being used.
I'm a bit puzzled by this. If you see the OpenGL output on the remote display, then this would mean that instead of GLX commands pictures are transmitted. This however would mean, that the libGL.so on your host device is X11 aware for its output, but won't use GLX.
Could you please determine which package contributes the libGL.so on your ARM device. I suggest you install a separate libGL.so with only GLX command generation and LD_PRELOAD that.
Mesa3D can be configured to build GLX command stream generator library.
I have a small piece of code that works as a plugin for a larger graphics application. The development platform is Qt with c++ code. I've managed to build a .so, .dylib and .dll for linux, MacOS and Windows respectively, but to do so I had to have a machine running each operating system (in my case, running linux [ubuntu] gcc natively, and windows MinGW and MacOS XCode gcc in virtual machines).
Is there a way to build for all 3 platforms from one? I beat my head against this problem a while back, and research to date suggests that it's not easily (or feasibly) done. The code only needs to link against a single header that defines the plugin
API and is built from a fairly basic Makefile (currently with small variations per platform).
You should have a look at crosscompiling.
You basically build a compiler that (on your current plattform) will output binaries for your desired platforms.
Try this link about doing it on linux, for windows, with QT
Better late than never, I just came across IMCROSS
It looks quite promising!
For Linux it is fairly easy to setup or even download a virtual machine using VMWare for instance. Getting OSX to run on VMWare is somewhat tricky but possible.
Running VMWare and sharing a directory on a local drive you can even compile for the different platforms using the same exact files.
There is somewhere a cross-compiler for OSX but I wouldn't trust it to be of great quality.