Difference between revisions of "VTK/OpenGL"

From KitwarePublic
< VTK
Jump to navigationJump to search
 
(40 intermediate revisions by 10 users not shown)
Line 1: Line 1:
==ATI Open GL Driver on Linux==
+
'''THIS INFORMATION IS OUT OF DATE AND SHOULD NOT BE USED'''--[[User:Burlen|Burlen]] 15:50, 11 November 2013 (EST)
 +
= Linux =
 +
==ATI Open GL Driver==
 +
 
 +
===ATI Driver on Debian GNU/Linux===
 +
 
 +
http://wiki.cchtml.com/index.php/Debian_Installation_Guide#Compile_the_kernel_driver
 +
 
 +
I tested Method1 only
 +
--[[User:Mathieu|Mathieu]] 22:53, 17 October 2006 (EDT)
  
  
===ATI Driver on Debian GNU/Linux===
 
  
How to get OpenGL ATI driver working on a linux debian system.
+
===ATI Driver on Fedora 2===
 +
Other (untested) How To:
 +
* Fedora 2:
 +
http://www.redhat.com/archives/fedora-list/2004-May/msg06859.html
 +
 
 +
===Debugging the ATI libGL===
  
This wiki page is based on:
+
Some env var you should remember:
http://www.watchland.org/dmcgraw/ati-debian.html
 
  
* Download the RPM from ATI (it should match your for XFree version)
+
  LIBGL_ALWAYS_INDIRECT=1
  
Go to: http://ati.com/support/driver.html
+
  LIBGL_VERBOSE=1
  
* Use 'alien' to change the rpm into a tarball (alien -t), then extract at file system root level:
+
  LIBGL_DEBUG=verbose
  
  cd /
+
===Documentation for fglrx options===
  sudo tar xvfz fglrx-4.3.0.tgz
+
Daniel Leidert wrote a man page at:
  
* Install the kernel headers for your kernel
+
* http://www.stanchina.net/~flavio/debian/fglrx-archive/msg01017.html
 +
* http://cvs.wgdd.de/cgi-bin/cvsweb/fglrx_man/
 +
* [http://ati.cchtml.com/ Unofficial bug tracker: http://ati.cchtml.com/]
 +
* [http://gentoo-wiki.com/HOWTO_ATI_Drivers HOWTO ATI Drivers]
  
apt-get install kernel-headers-`uname -r`
+
==nVidia Open GL Driver on Linux==
  
* Install the kernel-source package for your kernel
+
===nVidia Driver on Debian GNU/Linux===
  
apt-get install kernel-source-<ver>
+
How to get OpenGL nVidia driver working on a linux debian system.
  
* Create a symlink for /usr/src/linux to the kernel-headers. Technically this isn't needed, but it makes it easier to keep things straight.
+
First thing you need to do is allow non-free packages from your sources.list file.
  
ln -s /usr/src/kernel-headers-`uname -r` /usr/src/linux
+
  # Be carefull only for nvidia-kernel-source
 +
  deb http://ftp.us.debian.org/debian/ stable main ''non-free'' contrib
  
* Build & Install the module
 
  
cd /lib/modules/fglrx/build_mod
+
  sudo apt-get update
 +
  sudo apt-get install nvidia-glx-dev nvidia-settings nvidia-xconfig
 +
  sudo nvidia-xconfig
  
sudo sh make.sh
+
IMPORTANT: You have to be careful when you read the articles about this process around Internet! Because many of the documents around internet are very old. Since Debian 5.0(Lenny) you don't have to build your own kernel module. Pre-built packages are working perfectly.
  
cd ..
+
CAUTION: A very new flagship graphic card will probably not be supported by the pre-built package. You may try one in experimental or unstable release. You may end up with replacing you card or building it from the scratch.
 +
If you build from the scratch, please refer the document to keep your work in Debian way.
  
sudo sh make_install.sh
+
  http://wiki.debian.org/NvidiaGraphicsDrivers
  
* Optionally (but I recommend it to at least learn the options you can use) run fglrxconfig to generate a XF86Config-4 file
+
===nVidia Driver on Ubuntu ===
  
* To build VTK you may still need the OpenGL header file:
+
The Wiki page is fairly simple just linking to [http://ubuntulinux.org/wiki/BinaryDriverHowto it]
  
  sudo apt-get install xlibmesa-gl-dev
+
Since the debian way seems to be broken http://packages.ubuntu.com/hoary/misc/java-package, here is how to install Java on [http://www.ubuntulinux.org/wiki/Java ubuntu].
  
Some more info depending on your kernel:
+
= Mac OS X =
 +
== Corrupted Display ==
 +
If it happens with an ATI card from the r600 series (2600 XT) or the r500 series (older series) or with an nVidia GeForce 7 series, you probably had called SetStereoWindowCapable(true) on the RenderWindow. This a driver bug, known by Apple. The only workaround is to call SetStereoWindowCapable(false).
  
- For a 2.4.x kernel
+
ref: [http://www.vtk.org/Bug/view.php?id=9191 VTK bug report], [http://lists.apple.com/archives/x11-users/2009/Jun/msg00135.html thread on the Apple mailing list]
  
  Edit a couple of locations in the ATI make.sh script. Really you just need to check/set 2 variables.
+
= Mesa, Off Screen Mesa, Mangled Mesa =
  - First search for linuxincludes. Make sure that is set to /usr/src/linux/include (if you made the symlink above).
 
  - Then search for drmincludes. Make sure that is set to /usr/src/kernel-source-<ver>drivers/char/drm
 
  
- For a 2.6.x kernel
 
  
  * Create a symlink for the modules build directory
+
Various setups:
  
  ln -s /usr/src/linux /lib/modules/`uname-r`/build
+
* Pure OpenGL
 +
* Pure Mesa (no hardware and it has off screen natively)
 +
* OpenGL + Mangled Mesa (hardware on-screen and software off-screen)
  
  * Change the kernel headers to reference the kernel source package's drm include
+
==Pure Mesa==
  
  * cd /usr/src
+
* Enable ''VTK_OPENGL_HAS_OSMESA''
 +
* Set the following values to apropriate locations:
  
  * tar -jxvf kernel-source-<ver>.tar.bz2
+
OSMESA_INCLUDE_DIR /.../include
 +
OSMESA_LIBRARY    /.../lib/libOSMesa.a
  
  * cd linux/drivers/char
+
==OpenGL + Off screen==
  
  * mv drm drm.original
+
To do hardware rendering (on screen) and software rendering (off screen) within the same application, you will have to use mangled mesa. Mangled mesa is build using all symbols mangled.
  
  * ln -s /usr/src/kernel-source-<ver>drivers/char/drm drm
+
You may want to first look at article [[VTK:How I mangled Mesa|How I Mangled Mesa]].
  
 +
===Build Mangled Mesa===
  
----
+
The following refers to Mesa 6.2.*
Another source for getting the ATI driver working on Debian is:
 
[http://xoomer.virgilio.it/flavio.stanchina/debian/fglrx-installer.html]
 
  
This site provides binary .debs for everything but the kernel module.  It
+
Edit apropriate system configuration file. On Linux, for example, if you are building static, edit the file:
provides a source .deb for the module.
 
  
The latest version of the ATI driver does not require full kernel sources to
+
  /path/to/source/config/linux-static
build the module.  You just need a kernel header package. I used debs from the
 
site cited above, installed the header package corresponding to the official
 
binary kernel that I am running, and used ATI's "make.sh" script (comes with the
 
kernel module source .deb) to build the fglrx.ko module.  I installed fglrx.ko
 
by hand.
 
  
I suggest that using these ready to go, but unoffical .debs is far easier than
+
Edit the CFLAGS line and add the following at the end of CFLAGS and CXXFLAGS:
going the alien route.
 
  
----
+
-DUSE_MGL_NAMESPACE
  
===ATI Driver on Fedora 2===
+
Then edit file:
Other (untested) How To:
 
* Fedora 2:
 
http://www.redhat.com/archives/fedora-list/2004-May/msg06859.html
 
  
===Related Information===
+
/path/to/source/config/default
  
* Some links:
+
And rename the standard names for the libraries, for example:
Support for ATI Radeon & FireGL graphics cards on Linux
 
http://www.wlug.org.nz/RadeonNotes
 
  
Some FireGL driver:
+
# Library names (base name)
http://www.schneider-digital.de/html/download_ati.php
+
GL_LIB = MesaGL
 +
GLU_LIB = MesaGLU
 +
GLUT_LIB = MesaGlut
 +
GLW_LIB = MesaGLw
 +
OSMESA_LIB = MesaOSMesa
  
Installing ATI-Drivers on Debian Linux(nforce2 chipset)
+
===Setup VTK===
http://www.g-tec.co.at/ati.html
 
  
Another [http://www.gmpf.de/ ATI-Radeon-Linux-Howto] which is also available in german.
+
* Disable VTK_OPENGL_HAS_OSMESA
  
This [http://www.rage3d.com/content/articles/atilinuxhowto/ ATI-Radeon-Linux-Howto] also includes information about installing the drivers on other distributions.
+
* Make sure OpenGL settings are set to the hardware OpenGL library:
  
[http://xoomer.virgilio.it/flavio.stanchina/debian/fglrx-installer.html ATI Linux driver packages for Debian] Another HowTo for Debian, also includes Debian packages and reports of working setups.
+
OPENGL_INCLUDE_DIR              /usr/include                                                                                                                         
 +
OPENGL_gl_LIBRARY                /usr/lib/libGL.so                                                                                                                     
 +
OPENGL_glu_LIBRARY              /usr/lib/libGLU.so                                                                                                                   
  
A [http://www2.ati.com/drivers/linux/readme0328.txt link] to ATI web site where to find some documentation about the XFree86 file option generated from fglrxconfig
+
* Enable VTK_USE_MANGLED_MESA
  
 +
* Set mangled mesa options:
  
==nVidia Open GL Driver on Linux==
+
MANGLED_MESA_INCLUDE_DIR        /.../include
 +
MANGLED_MESA_LIBRARY            /.../lib/libMesaGL.a
 +
MANGLED_OSMESA_INCLUDE_DIR      /.../include
 +
MANGLED_OSMESA_LIBRARY          /.../lib/libMesaOSMesa.a
  
===nVidia Driver on Debian GNU/Linux===
+
===Use of Mangled Mesa===
  
How to get OpenGL nVidia driver working on a linux debian system.
+
* For all mangled mesa calls, the vtk*Mesa* classes need to be used. For example, instead of vtkRenderWindow, vtkXMesaRenderWindow must be used. The full list of classes is:
  
This wiki page is based on:
+
<pre>vtkXMesaRenderWindow
 +
vtkMesaActor
 +
vtkMesaCamera
 +
vtkMesaImageActor
 +
vtkMesaLight
 +
vtkMesaProperty
 +
vtkMesaPolyDataMapper
 +
vtkMesaRenderer
 +
vtkMesaTexture
 +
vtkMesaVolumeTextureMapper2D
 +
vtkMesaVolumeRayCastMapper
 +
vtkMesaRayCastImageDisplayHelper
 +
vtkMesaFreeTypeTextMapper
 +
vtkMesaImageMapper
 +
vtkMesaPolyDataMapper2D</pre>
  
http://home.comcast.net/~andrex/Debian-nVidia/index.html
+
* To make Mangled mesa to be default, do the following at beginning of the program:
  
First thing you need to do is allow unstable from your sources.list file otherwise even the assistant will fail to load the nvidia-kernel-source package
+
vtkGraphicsFactory::SetUseMesaClasses(1);
 +
vtkImagingFactory::SetUseMesaClasses(1);
  
  # Be carefull only for nvidia-kernel-source
+
{{VTK/Template/Footer}}
  deb http://ftp.us.debian.org/debian/ unstable main non-free contrib
 

Latest revision as of 15:50, 11 November 2013

THIS INFORMATION IS OUT OF DATE AND SHOULD NOT BE USED--Burlen 15:50, 11 November 2013 (EST)

Linux

ATI Open GL Driver

ATI Driver on Debian GNU/Linux

http://wiki.cchtml.com/index.php/Debian_Installation_Guide#Compile_the_kernel_driver

I tested Method1 only --Mathieu 22:53, 17 October 2006 (EDT)


ATI Driver on Fedora 2

Other (untested) How To:

  • Fedora 2:

http://www.redhat.com/archives/fedora-list/2004-May/msg06859.html

Debugging the ATI libGL

Some env var you should remember:

 LIBGL_ALWAYS_INDIRECT=1
 LIBGL_VERBOSE=1
 LIBGL_DEBUG=verbose

Documentation for fglrx options

Daniel Leidert wrote a man page at:

nVidia Open GL Driver on Linux

nVidia Driver on Debian GNU/Linux

How to get OpenGL nVidia driver working on a linux debian system.

First thing you need to do is allow non-free packages from your sources.list file.

 # Be carefull only for nvidia-kernel-source
 deb http://ftp.us.debian.org/debian/ stable main non-free contrib


 sudo apt-get update
 sudo apt-get install nvidia-glx-dev nvidia-settings nvidia-xconfig
 sudo nvidia-xconfig

IMPORTANT: You have to be careful when you read the articles about this process around Internet! Because many of the documents around internet are very old. Since Debian 5.0(Lenny) you don't have to build your own kernel module. Pre-built packages are working perfectly.

CAUTION: A very new flagship graphic card will probably not be supported by the pre-built package. You may try one in experimental or unstable release. You may end up with replacing you card or building it from the scratch. If you build from the scratch, please refer the document to keep your work in Debian way.

 http://wiki.debian.org/NvidiaGraphicsDrivers

nVidia Driver on Ubuntu

The Wiki page is fairly simple just linking to it

Since the debian way seems to be broken http://packages.ubuntu.com/hoary/misc/java-package, here is how to install Java on ubuntu.

Mac OS X

Corrupted Display

If it happens with an ATI card from the r600 series (2600 XT) or the r500 series (older series) or with an nVidia GeForce 7 series, you probably had called SetStereoWindowCapable(true) on the RenderWindow. This a driver bug, known by Apple. The only workaround is to call SetStereoWindowCapable(false).

ref: VTK bug report, thread on the Apple mailing list

Mesa, Off Screen Mesa, Mangled Mesa

Various setups:

  • Pure OpenGL
  • Pure Mesa (no hardware and it has off screen natively)
  • OpenGL + Mangled Mesa (hardware on-screen and software off-screen)

Pure Mesa

  • Enable VTK_OPENGL_HAS_OSMESA
  • Set the following values to apropriate locations:
OSMESA_INCLUDE_DIR /.../include
OSMESA_LIBRARY     /.../lib/libOSMesa.a

OpenGL + Off screen

To do hardware rendering (on screen) and software rendering (off screen) within the same application, you will have to use mangled mesa. Mangled mesa is build using all symbols mangled.

You may want to first look at article How I Mangled Mesa.

Build Mangled Mesa

The following refers to Mesa 6.2.*

Edit apropriate system configuration file. On Linux, for example, if you are building static, edit the file:

/path/to/source/config/linux-static

Edit the CFLAGS line and add the following at the end of CFLAGS and CXXFLAGS:

-DUSE_MGL_NAMESPACE

Then edit file:

/path/to/source/config/default

And rename the standard names for the libraries, for example:

# Library names (base name)
GL_LIB = MesaGL
GLU_LIB = MesaGLU
GLUT_LIB = MesaGlut
GLW_LIB = MesaGLw
OSMESA_LIB = MesaOSMesa

Setup VTK

  • Disable VTK_OPENGL_HAS_OSMESA
  • Make sure OpenGL settings are set to the hardware OpenGL library:
OPENGL_INCLUDE_DIR               /usr/include                                                                                                                           
OPENGL_gl_LIBRARY                /usr/lib/libGL.so                                                                                                                      
OPENGL_glu_LIBRARY               /usr/lib/libGLU.so                                                                                                                     
  • Enable VTK_USE_MANGLED_MESA
  • Set mangled mesa options:
MANGLED_MESA_INCLUDE_DIR        /.../include
MANGLED_MESA_LIBRARY            /.../lib/libMesaGL.a
MANGLED_OSMESA_INCLUDE_DIR      /.../include
MANGLED_OSMESA_LIBRARY          /.../lib/libMesaOSMesa.a

Use of Mangled Mesa

  • For all mangled mesa calls, the vtk*Mesa* classes need to be used. For example, instead of vtkRenderWindow, vtkXMesaRenderWindow must be used. The full list of classes is:
vtkXMesaRenderWindow
vtkMesaActor
vtkMesaCamera
vtkMesaImageActor
vtkMesaLight
vtkMesaProperty
vtkMesaPolyDataMapper
vtkMesaRenderer
vtkMesaTexture
vtkMesaVolumeTextureMapper2D
vtkMesaVolumeRayCastMapper
vtkMesaRayCastImageDisplayHelper
vtkMesaFreeTypeTextMapper
vtkMesaImageMapper
vtkMesaPolyDataMapper2D
  • To make Mangled mesa to be default, do the following at beginning of the program:
vtkGraphicsFactory::SetUseMesaClasses(1);
vtkImagingFactory::SetUseMesaClasses(1);



VTK: [Welcome | Site Map]