1![OpenGL](../images/icons/opengl.png)
2
3This documentation is about running OpenGL _applications_ in an xpra session and this has nothing to do with the [client's opengl acceleration](./Client-OpenGL.md).
4
5By default, OpenGL applications are supported but they are executed in a virtual framebuffer context which uses a software renderer, and therefore without any GPU acceleration.
6
7
8# GPU Acceleration
9To take advantage of GPU [OpenGL](https://www.opengl.org/) acceleration, here are some options:
10
11* ## VirtualGL
12[VirtualGL](http://www.virtualgl.org/) does API intercept and delegates OpenGL acceleration to a real GPU. Example:
13```shell
14xpra start --start="vglrun glxgears"
15```
16Or even:
17```shell
18xpra start --exec-wrapper="vglrun" --start="glxgears"
19```
20
21* ## via Xwayland
22From within an X11 session, you can use start the Weston Wayland compositor, then start Xwayland and the xpra server with the `-use-display` option:
23```shell
24Xwayland :20 &
25xpra start :20 --use-display
26```
27(the Weston window can be hidden)
28
29
30* ## Shadowing
31If the GPU is driving an existing display, you can [shadow](./Shadow-Server.md) it.\
32The limitation here is that the performance of shadow sessions is inferior to [seamless](./Seamless.md) and [desktop](./Start-Desktop.md) sessions.
33
34
35* ## Taking over an existing display
36Similarly to the shadow solution, you can tell xpra to take over an existing X11 display and manage it for remote access using the `--use-display` flag:
37```shell
38xpra start --use-display :0
39```
40The downside is that the session is no longer accessible from the local display.
41
42
43***
44
45
46# Caveats
47
48## GL library conflicts
49Proprietary graphics drivers can interfere with software OpenGL, [glvnd](https://github.com/NVIDIA/libglvnd) can solve this issue by allowing multiple OpenGL libraries to co-exist.
50
51## Stability
52VirtualGL and Xwayland will tie the OpenGL application to a secondary context (X11 / Wayland server) and if this server is killed or restarted then the application will crash.
53
54## VirtualGL setup
55Please refer to the extensive [documentation](https://github.com/VirtualGL/virtualgl/tree/master/doc).
56Some applications may require workarounds, ie: [12: Using VirtualGL with setuid/setgid Executables
57](https://github.com/VirtualGL/virtualgl/blob/master/doc/setuid.txt).
58