https://github.com/aancel/admin/wiki/VirtualGL-on-Ubuntu
https://virtualgl.org/About/Introduction
When you use ssh with X forwarding, you might have noticed that you cannot execute programs that require 3D acceleration. That's where VirtualGL comes into play.
VirtualGL is an open source toolkit that gives any Unix or Linux remote display software the ability to run OpenGL applications with full 3D hardware acceleration.
With VirtualGL, the OpenGL commands and 3D data are instead redirected to a 3D graphics accelerator (AKA "graphics processing unit" or "GPU") in the application server, and only the rendered 3D images are sent to the client machine.
Download the following packages for the server:
- The .deb package for VirtualGL on sourceforge
- The .deb package for TurboVNC on sourceforge
-
Make sure you have installed the proprietary drivers for your graphics card (at least for Nvidia that I have tested this setup).
-
Install virtualgl on Ubuntu, by installing the deb file you already downloaded:
sudo dpkg -i virtualgl_*.deb
- Shutdown the display manager and configure virtualgl server:
# login as root
# If you are using KDE, install lightdm (sudo apt-get install lightdm)
# otherwise the following configuration steps do not work with SDDM (yet)
service lightdm stop
/opt/VirtualGL/bin/vglserver_config
# Go through the questions until the configuration is done.
sudo reboot
# Sanity check for restricted access to 3D X Server
xauth merge /etc/opt/VirtualGL/vgl_xauth_key
xdpyinfo -display :0
/opt/VirtualGL/bin/glxinfo -display :0 -c
# Check that the Graphic card is indeed used and not Mesa
- Install TurboVNC:
sudo dpkg -i turbovnc_*.deb
For the TurboVNC clients, you can find them at the same address
- Launch
/opt/TurboVNC/bin/vncserver
on the server. Possible options:- -otp: enable One Time Password
- -geometry x: specify size of the window
- Connect using TurboVNC client (
/opt/TurboVNC/bin/vncviewer
). (The screen will appear black but X is launched) - In a terminal on the server
- export the DISPLAY variable to the value used by vncserver
export DISPLAY=:1 # if your vncserver started in DISPLAY :1
- Launch an X App (with vglrun to have 3D acceleration)
# Example command vglrun glxgears
-
To get a window manager up and running (in order to not have the black screen) do the following:
- With the command
vncserver -list
find the started vnc server. This command will give you an output that looks like this:
$ vncserver -list TurboVNC server sessions: X DISPLAY # PROCESS ID :1 8972
-
Kill the started VNC server with the command
vncserver -kill :1
. Change the:1
with theX DISPLAY
value returned by thevncserver -list
command earlier. -
Make sure that the commands
xfce4-panel
andxfce4-session
exist in your system (if not install them), and append the following line at the end of the file~/.vnc/xstartup.turbovnc
.
xfce4-session &
- Now start the vncserver again:
/opt/TurboVNC/bin/vncserver
- With the command
-
Export PATH variables:
export PATH=/opt/TurboVNC/bin:$PATH
Hello,
i am trying to get any android studio emulator running with OpenGL / GPU support.
I followed the docs here and running "vglrun glxgears" worked fine.
Now i tried starting android studio the same like
/opt/android-studio/bin # vglrun ./studio.sh
It starts Android Studio and i can see everything through TurboVNC Viewer Client now.
But still getting the same errors when trying to run any emulator with Emulated Performance.
Any idea how to get this working?