Amazon EC2 Ubuntu + Xvfb: libGL error: failed to load driver: swrast
Asked Answered
H

2

6

I am trying to run ParaView through Xvfb in a Ubuntu instance on Amazon EC2. I have installed X11/Xvfb related packages as per http://mike.ucoz.com/publ/programming/ubuntu/selenium_ubuntu_amazon_ec2_headless/8-1-0-4

But I can't seem to get past an error associated with the swrast library.

Here are the message when starting Xfvb

$ export DISPLAY=:99
$ Xvfb $DISPLAY &
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension GLX
[dix] Could not init font path element /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, removing from list!

I could not see anything dramatic above. But when running glxinfo

$ glxinfo
name of display: :99
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL error: failed to load driver: swrast
Error: couldn't find RGB GLX visual or fbconfig

144 GLXFBConfigs:
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav

Note:

$ ls /usr/lib/x86_64-linux-gnu/dri/
dummy_drv_video.so  nouveau_dri.so        r300_dri.so    radeonsi_dri.so
i915_dri.so         nouveau_vieux_dri.so  r600_dri.so    swrast_dri.so
i965_dri.so         r200_dri.so           radeon_dri.so  vmwgfx_dri.so

Thanks in advance.

Hogshead answered 23/9, 2013 at 0:22 Comment(5)
There is no video device available on most EC2 instances. The GPU instances may work, but they are based on the Nvidia Tesla cards (designed for CUDA processing)Glowing
There is no video device indeed. I am trying to use ParaView in a batch mode (pvbatch) to generate pictures automatically. I was under the impression that using Xvfb would allow this to happens.Hogshead
When I run pvbatch, pvbatch fails with the same error message as glxinfo.Hogshead
Do you think that recompiling ParaView with OSMesa as per paraview.org/Wiki/Setting_up_a_ParaView_Server could go around the issue? Anyone has done this before?Hogshead
Your problem seems different since on my system glxinfo yields no error. But this answer might give a hint.Reprieve
A
1

Assuming that you have xvfb-run installed, you can try with:

xvfb-run --auto-servernum -s "-screen 0 640x480x24" <something_that_needs_X11> 

Source: https://bugzilla.redhat.com/show_bug.cgi?id=904851#c5

Aerodrome answered 20/9, 2016 at 13:4 Comment(0)
F
0

Amazon EC2 uses Nvidia GPU, so the problem may caused by NV driver.

Just give it a try, run it with docker container, based on my dockerfile Dockerfile_cuda80

This dockerfile is based on official cuda image, modified to run all cuda samples with OpenGL, you should use nvidia-docker to build & run it.

This solves my similar problem while running windows program via WINE.

Fungible answered 31/10, 2017 at 9:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.