When I install a nvidia proprietary driver then Nvidia OpenGL implementation is used (I don't need Mesa). Which OpenGL implementation can be used with an open source nvidia driver - Nouveau ? Does Nouveau also provide OpenGL implementation or it has to use Mesa OpenGL implementation ? Can I use nvidia drivers with Mesa OpenGL implementation ? What are possibilities ?
Best How To :
First things first: The open source graphics drivers, all of them, use Mesa for the front side OpenGL interface and state tracking.
Let's break this down: Theoretically a OpenGL implementation can directly talk to the hardware. This is what the NVidia and AMD proprietary drivers actually do.
But in the open source world code reuse is highly favoured. So a typical open source graphics driver looks like this:
User API frontend (OpenGL + state tracker) → abstraction layer (Gallium3D or device specific internal layer) → kernel backend.
The Mesa project actually encompasses the whole chain. The OpenGL part of Mesa, (the frontend) can attack to different abstraction layers (for example also a software rasterizer, softpipe/llvm for example). But the Mesa project is also an umbrella for the other parts: The userland graphics drivers (nouveau, radeon, intel and so on), the infrastructure that allows for userspace processes to directly talk to the graphics driver, bypassing display servers (DRI) and the kernel interface (DRM), as well the kernel modules.
A few weeks ago AMD released a new kernel module (amdgpu) that uses the DRM API, is open source and will be merged into the Linux kernel. That new kernel module is there to be used by both the proprietary AMD OpenGL drivers and the open source Mesa drivers. AMD is pushing for open source for some time now and the logical next step would be, that AMD ditches their own OpenGL frontend in favor of Mesa and providing their proprietary driver as a middle end that plug into Mesa.
Can I use nvidia drivers with Mesa OpenGL implementation ?
That depends. If you're doing indirect OpenGL over X11 then in fact you can use the Mesa libGL.so for your program, talking through the X11 server to the nvidia backend driver. However used that way libGL.so merely acts as a GLX conduit. It works the other way round as well BTW.
However since this lacks "direct GL context" capabilities you'll not be able to use OpenGL features for which no indirect opcodes have been defined; that would be anything OpenGL-3 or later, sadly. Also if your data is highly dynamic there is some significant bottleneck due to serializing the command stream (theoretically using syscalls like vmsplice most of the overhead could be alleviated, though).