[vtkusers] OSMESA causes some segfaults

Kevin H. Hobbs hobbsk at ohiou.edu
Sat Jan 9 06:51:38 EST 2010


On 01/08/2010 08:28 PM, David Doria wrote:
> If I compile with VTK_OPENGL_HAS_OSMESA ON, then try to do something
> normal (non offscreen rendering) and simple like this:
>
> http://www.cmake.org/Wiki/VTK_Examples_Display_Cube
>
> I get a segfault. It happens in
>
> void vtkXOpenGLRenderWindow::Start(void)
>
> The only reason I turned on HAS_OSMESA was to test the offscreen
> rendering example - but shouldn't I be able to keep this on and do
> on-screen rendering too?
>   

Yes, with Mesa and OSMesa you should be able to do onscreen rendering
without hardware acceleration, and offscreen rendering.

I suspect that you are mixing parts of Mesa built to support hardware
accelerated rendering and OSMesa.

I have a few questions for you :

  What operating system are you using?

  Where does your GL library come from, a package or did you build it
with Mesa?

  Where does your OSMesa library come from, a package or did you build
it with Mesa?

  Are you sure you are linking against the correct GL library?

  What does 'grep OSMESA_LIBRARY CMakeCache.txt' in your VTK build
directory say?

  What does 'grep OPENGL_gl_LIBRARY CMakeCache.txt' in your VTK build
directory say?

  What does 'ldd DisplayCube | grep GL' say?

  What does 'ldd DisplayCube | grep OSMesa' say?

  Did you build VTK with rpath set?

  Does your LD_LIBRARY_PATH shell variable direct the linker to find the
right GL and OSMesa libraries?


At least on my operating system (Fedora) the "system" GL library 
/usr/lib64/libGL.so comes from Mesa :

  rpm -q --whatprovides /usr/lib64/libGL.so
  mesa-libGL-devel-7.6-0.13.fc12.x86_64

This library has been built to support DRI hardware acceleration and
does not work, at least as far as VTK is concerned with the OSMesa
library provided by the mesa-libOSMesa package.

There are also the Libraries provided by Nvidia through RPMFusion. The
linker path is set to find these before the "system" libraries :

  cat /etc/ld.so.conf.d/nvidia-lib64.conf
  /usr/lib64/nvidia

I build Mesa with OSMesa and without DRI from source in my home
directory with the command :

  make linux-x86-64

Then when I'm building VTK I direct CMake to these libraries and headers
files.

I either set rpath when building VTK or I set my LD_LIBRARY_PATH shell
variable before running the offscreen rendering application.

I hope this helps some.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100109/7c49f7ab/attachment.pgp>


More information about the vtkusers mailing list