Use osmesa on headless Chromium with Xvfb

2,108 views
Skip to first unread message

Francisco Ávila

unread,
Aug 16, 2013, 6:35:55 PM8/16/13
to chromium...@chromium.org
I'm trying to run WebGL on either Chromium or Chrome in an EC2 instance using Xvfb. I have tried to use Mesa for software rendering but it's not working. I get the following message: "While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card."

I think I'm not linking osmesa properly. What am I doing wrong?

- Installed Chromium with 'sudo apt-get install chromium-browser'

- Output of 'dpkg -l *mesa*':

 Name                             Version                          Description
+++-================================-================================-============================================================
un  libgl1-mesa-dev                  <none>                           (no description available)
ii  libgl1-mesa-dri                  8.0.4-0ubuntu0.5                 free implementation of the OpenGL API -- DRI modules
un  libgl1-mesa-dri-experimental     <none>                           (no description available)
rc  libgl1-mesa-glx                  8.0.4-0ubuntu0.6                 free implementation of the OpenGL API -- GLX runtime
un  libgl1-mesa-glx-no-multiarch     <none>                           (no description available)
un  libgl1-mesa-swrast               <none>                           (no description available)
un  libgl1-mesa-swrast-dev           <none>                           (no description available)
ii  libgl1-mesa-swx11                8.0.4-0ubuntu0.6                 free implementation of the OpenGL API -- runtime
ii  libgl1-mesa-swx11-dev            8.0.4-0ubuntu0.6                 free implementation of the OpenGL API -- development files
ii  libglapi-mesa                    8.0.4-0ubuntu0.6                 free implementation of the GL API -- shared library
ii  libglu1-mesa                     8.0.4-0ubuntu0.5                 Mesa OpenGL utility library (GLU)
un  libosmesa-dev                    <none>                           (no description available)
un  libosmesa4-dev                   <none>                           (no description available)
ii  libosmesa6                       8.0.4-0ubuntu0.6                 Mesa Off-screen rendering extension
ii  libosmesa6-dev                   8.0.4-0ubuntu0.6                 Mesa Off-screen rendering extension -- development files
ii  mesa-common-dev                  8.0.4-0ubuntu0.6                 Developer documentation for Mesa
un  mesa-common-dev-lts-quantal      <none>                           (no description available)
un  mesa-common-dev-lts-raring       <none>                           (no description available)
un  mesa-dev                         <none>                           (no description available)
ii  mesa-utils                       8.0.1+git20110129+d8f7d6b-0ubunt Miscellaneous Mesa GL utilities
un  mesag-dev                        <none>                           (no description available)
un  mesag3                           <none>                           (no description available)
un  mesag3+ggi                       <none>                           (no description available)
un  mesag3-glide                     <none>                           (no description available)
un  mesag3-glide2                    <none>                           (no description available)
un  xlibmesa-dri                     <none>                           (no description available)
un  xlibmesa-gl-dev                  <none>                           (no description available)
un  xlibmesa3                        <none>                           (no description available)
un  xlibosmesa-dev                   <none>                           (no description available)

- Output of 'glxinfo | grep render':
direct rendering: Yes
OpenGL renderer string: Mesa X11

- Output of 'glxinfo | grep OpenGL':
OpenGL vendor string: Brian Paul
OpenGL renderer string: Mesa X11
OpenGL version string: 2.1 Mesa 8.0.4
OpenGL shading language version string: 1.20

- How I run Chromium on Xvfb:
export DISPLAY=:0
xvfb-run --server-num=0 --server-args='-screen 0, 1024x768x24' chromium-browser --ignore-gpu-blacklist --use-gl=/usr/lib/x86_64-linux-gnu/libOSMesa.so --enable-webgl --start-maximized get.webgl.org &
* Note: also tried with --use-gl=osmesa

- How I get a screenshot:
DISPLAY=:0 import -window root getwebgl.png

Thanks.

Kenneth Russell

unread,
Aug 23, 2013, 8:34:16 PM8/23/13
to Francisco Ávila, Chromium-discuss
I think you'll need to check out the top of tree Chromium sources and
build at least the "osmesa" target to get a libosmesa.so known to work
with Chromium, then copy it alongside the "chrome" binary from a
continuous build from
http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?path=Linux_x64/
and try running again with --use-gl=osmesa .

Running with --enable-logging should produce
~/.config/chromium/chrome_debug.log which may give more hints about
what went wrong.

-Ken
> --
> --
> Chromium Discussion mailing list: chromium...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-discuss
>

Kenneth Russell

unread,
Aug 27, 2013, 8:02:01 PM8/27/13
to Francisco Avila, Chromium-discuss
Glad it's working. Sorry for the difficulty.

-Ken


On Tue, Aug 27, 2013 at 11:10 AM, Francisco Avila <elfra...@gmail.com> wrote:
> After compiling chromium from source, it works. It was more work than
> expected on debian.
>
> xvfb-run -f ~/.Xauthority --server-num=0 --server-args='-screen 0,
> 1024x768x24' ./chrome --use-gl=osmesa --enable-webgl --ignore-gpu-blacklist
> --window-size=1024,768 http://get.webgl.org &
>
> -Frank

Francisco Avila

unread,
Aug 27, 2013, 2:10:56 PM8/27/13
to Kenneth Russell, Chromium-discuss
After compiling chromium from source, it works. It was more work than expected on debian.

xvfb-run -f ~/.Xauthority --server-num=0 --server-args='-screen 0, 1024x768x24' ./chrome --use-gl=osmesa --enable-webgl --ignore-gpu-blacklist --window-size=1024,768 http://get.webgl.org & 

-Frank


On Fri, Aug 23, 2013 at 5:34 PM, Kenneth Russell <k...@chromium.org> wrote:
Reply all
Reply to author
Forward
0 new messages