# VirtualGL for FreeBSD



## lockdoc (Feb 26, 2012)

In order to have 3D acceleration for Virtualbox working *remotely* you *have* to start it from within Xorg. If you start it headlessly it will not use the 3d acceleration.

To overcome this problem, you can start it headless from VirtualGL (no X-server needed).
https://blogs.oracle.com/vizsun/entry/hardware_accelerated_remote_3d_windows

So I would really like to setup remote 3d accelerated operating systems on my FreeBSD server to make full use of it.

Has anybody gotten VirtualGL working for FreeBSD yet?


----------



## lockdoc (Feb 26, 2012)

I tried to _make_ it but it shows errors on the libjpeg-turbo library

```
cmake -G "Unix Makefiles" -DTJPEG_LIBRARY=/usr/local/lib/libturbojpeg.la
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- CMAKE_BUILD_TYPE = Release
-- VERSION = 2.3, BUILD = 20120226
-- CMAKE_INSTALL_PREFIX = /opt/VirtualGL
-- VGL_BINDIR = /opt/VirtualGL/bin
-- VGL_DOCDIR = /opt/VirtualGL/doc
-- 64-bit build
-- Linking with static libstdc++:
   /usr/lib/../lib/libstdc++.a
-- Looking for XOpenDisplay in /usr/local/lib/libX11.so;/usr/local/lib/libXext.so
-- Looking for XOpenDisplay in /usr/local/lib/libX11.so;/usr/local/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/local/lib/libX11.so
-- Found OpenGL: /usr/local/lib/libGL.so
-- X Video not available
-- TJPEG_INCLUDE_DIR = /usr/local/include
-- Performing Test TURBOJPEG_WORKS
-- Performing Test TURBOJPEG_WORKS - Failed
CMake Error at cmakescripts/FindTurboJPEG.cmake:56 (message):
  Could not link with TurboJPEG library /usr/local/lib/libturbojpeg.la.  If
  it is installed in a different place, then set TJPEG_LIBRARY accordingly.
Call Stack (most recent call first):
  CMakeLists.txt:250 (include)


-- Configuring incomplete, errors occurred!
```


----------



## toddnni (Feb 27, 2012)

I have been using it and turbovnc. I made even ports for them, but I haven't tried to push them to ports tree because I haven't had motivation to clean them up. If you are interested I can share them privately. I have a port for VirtualGL version 2.2.1 which doesn't use CMake.

However I recall that I had some minor problems with VirtualGL over SSH (VirtualGL client crashed every time I closed an application). I have been mostly using VirtualGL with turbovnc which works fine.


----------



## lockdoc (Feb 27, 2012)

Hi toddnni that sounds very good.
Actually I finally managed to compile the latest version of virtualGL and turboVNC, but somehow it does not ship all the binaries, such as vglrun which is the most important one.

Anyway, could you upload your ports here?


----------



## lockdoc (Feb 27, 2012)

I finally got the latest version of VirtualGL to work. Now I have a clarification problem.

My understanding so far was that with VirtualGL I do NOT need an X-server, as VirtualGL is able to communicate directly with the graphics card.
But even if I start my Virtual machine from withon vglrun

```
./vglrun VBoxHeadless -startvm "Windows XP" --vnc --vncpass pwd
```
I do not have Direct3D Acceleration in Windows. Now the questions is:

+ How does VirtualGL know my graphics card driver if it is not using X?
+ Do I actually have to install Xorg on the server for it to work?


----------



## toddnni (Feb 27, 2012)

To my understanding VirtualGL doesn't communicate directly with a graphic card, but uses X screen to render 3D image. VirtualGL users need X access to screen that renders (configured with xhost(1) command). I also noticed that rendering didn't work if a display device was unplugged from the graphics card (I need to find a way to create a X screen without a real display device).


----------



## lockdoc (Feb 27, 2012)

Yes you are right. I have read quite a lot by now.

The thing you want to achieve is called headless x-server. I have also already asked for it and the virtualGL people told me, that it is definitely possible and should be in their forums/mailing lists somewhere.

FYI is a little snap from their mail


> There is currently no way to access the GPU except through an X server,
> which is why we have to run one on the server.  At one time, Sun had a
> technology called "GLP" that allowed fully headless access to a GPU
> without going through an X server.  It used a GLX-like API to achieve
> ...



So lets keep us informed together on the progress. My main purpose is to have thin Clients with full 3d acceleration


Btw, there is also another project as far as i understand it is GPU clustering (or single machine) to do the rendering for the clients
http://vizstack.sourceforge.net/?page_id=39


----------



## lockdoc (Feb 27, 2012)

The latest version in svn trunk compiles without errors or modifications on FreeBSD.
Here is how to do it. I also have installed the latest libjpeg-turbo (not the ports version) --with-pic into /opt/

```
cmake -G "Unix Makefiles
make
make install
```

I am currently in contact with them in order to get vglrun to work with VirtualBox.
I will keep you informed about any progress.


----------



## lockdoc (Feb 28, 2012)

So it looks like that I cannot test any further as my ATI RV380 (Radeon X600) does not support pbuffer (pixel buffer) which is required by VirtualGL. :-(


----------

