InfoDoc ID   Synopsis   Date
22171   Sun OpenGL for Solaris - FAQ   11 Apr 2000

Status Issued

Description
Sun OpenGL for Solaris - FAQ


                            Contents: 
             
1.After installing OpenGL software, my application still fails to run. Why?
2.How do I enable Xinerama multi-screen displays and what do I need to get OpenGL running in Xinerama mode?
3.Is Sun OpenGL available for Solaris/Intel platforms?
4.Where can I get OpenGL GLUT libraries?
5.Where are the contents of OpenGL software packages installed?
6.Which Sun OpenGL software packages are required for 32-Bit run-time?
7.Which Sun OpenGL software packages are required for 64-Bit run-time?
8.How can I find out the release version number of OpenGL library I am using?
9.How come my glVertex*(), glNormal*(), etc. calls don't show in dbx()?
10.Can I run a program that uses OpenGL 1.0 extensions?
11.Running and viewing stereo applications
12.How many GLX windows can I used simultaneously?
13.Error using GLw: requested visual not supported
14.Emulating single-buffer using double-buffer context
15.How can I use OpenGL with overlay?
16.Using OpenGL for Solaris in C++ environment
17.General performance tips
18.Performance Tip: Rescale Normal
19.How can I obtain the list of OpenGL packages installed?
20.Can I use OpenGL if I mount /usr/openwin?
21.Why does ps(1) show my OpenGL application using so much space?
22.Where can you download opengl?
23.what are the System Requirements for Sun OpenGL?
24. ogl_install_check fails following message: cannot find GLX visual


 
1. After installing OpenGL software, my OpenGL application still fails to run. Why? 

Most of the time, this problem can be attributed to one the of the following reasons: 
The window server was not restarted after the installation of OpenGL software.

Xsun window server only loads server extension modules (GLX, PEX, etc.) at server initiation time or at the first invocation of the
extension protocol. In order to ensure that the OpenGL GLX server extension module is loaded by the Xsun server, it is necessary to
restart the Xsun window server after installing the OpenGL packages. If you are running OpenWindow, you can restart the window
server by simply logging out and logging back in. On systems running CDE, you'll need to restart to Xsun window server by exiting
the desktop session.

Some required software packages were not installed

To verify installation, refer to: Verifying OpenGL Installation 

2. How do I enable Xinerama mode for multi-screen displays and what do I need to get OpenGL running in Xinerama mode? 

To enable Xinerama mode (single logical screen) on multi-screen displays, add +xinerama to Xsun command in the /usr/dt/config/Xservers
file. For examples: 

:0 Local local_uid@console root /usr/openwin/bin/Xsun :0 -nobanner +xinerama -dev /dev/fb0 -dev /dev/fb1 

You need to install Sun OpenGL 1.2.1 (or later release) in order to run your OpenGL-based applications seamlessly in multi-screen
Xinerama mode; older release of Sun OpenGL will render only to one screen of the displays. 


3. Is Sun OpenGL available for Solaris/Intel platforms? 

Sun OpenGL is currently only available for Solaris/SPARC platforms. At this time, there is no plan for Sun to productize Sun OpenGL for
Solaris/Intel platforms. There are some OpenGL implementations for Solaris/Intel platforms available from third party: Mesa, and Xi Graphics
OpenGL are two that we are aware of. 


4. Where can I get OpenGL GLUT libraries? 

Source code for OpenGL GLUT libraries can be downloaded from the GLUT website. Instructions for downloading precompiled GLUT for
Solaris are on the Sun OpenGL demo website. 

5. Where are the contents of OpenGL software packages installed? 

  SUNWglrt
     OpenGL client-side runtime
     libraries
                                    /usr/openwin/lib
      GLX server extension
                                    /usr/openwin/server/modules
     Generic OpenGL libraries
                                    /usr/openwin/lib/GL
     Generic OpenGL device
     pipeline
                                    /usr/openwin/lib/GL/devhandlers
     xglinfo test program
                                    /usr/openwin/demo/GL
     ogl_install_check
                                    /usr/openwin/demo/GL
  SUNWglh
    OpenGL header files
                                    /usr/openwin/share/include/GL
    OpenGL widget header files
                                    /usr/openwin/share/include/X11/Glw
  SUNWglrtu
    UltraSPARC OpenGL libraries
                                    /usr/openwin/platform/sun4u/lib/GL
  SUNWgldoc
    OpenGL documentation, man
    pages, and specifications
                                    /usr/openwin/share/src/GL/docs
                                    /usr/openwin/share/man
                                    /usr/openwin/share/src/GL/docs/specs
  SUNWgleg
    OpenGL utilities and example
     programs
                                    /usr/openwin/share/src/GL/contrib
  SUNWafbgl
    Device pipeline for Elite 3D
                                    /usr/openwin/lib/GL/devhandler
  SUNWffbgl
    Device pipeline for Creator and
    Creator 3D Graphics frame
    buffers
                                    /usr/openwin/lib/GL/devhandler
  SUNWglrtx
    OpenGL 64-bit runtime
     libraries
                                    /usr/openwin/lib/sparcv9
    64-bit Generic OpenGL
    libraries
                                    /usr/openwin/platform/sun4u/lib/sparcv9/GL
    64-bit ogl_install_check
                                    /usr/openwin/demo/GL/sparcv9 
  SUNWffbgx
    64-bit device pipeline for
    Creator and Creator 3D
    Graphics frame buffers
                                    /usr/openwin/lib/sparcv9/GL/devhandler
  SUNWafbgx
    64-bit device pipeline for Elite
    3D Graphics frame buffers
                                    /usr/openwin/lib/sparcv9/GL/devhandler



7. Which Sun OpenGL software packages are required for 32-Bit run-time? 

The following three packages are required to run Sun OpenGL 1.1.2 for Solaris applications on the Creator family accelerator. 

                SUNWffbgl
                SUNWglrt
                SUNWglrtu

The following three packages are required to run Sun OpenGL 1.1.2 for Solaris applications on the Elite3D family accelerator. 

                 SUNWafbgl
                 SUNWglrt
                 SUNWglrtu


6. Which Sun OpenGL software packages are required for 64-Bit run-time? 

The following five packages are required to run Sun OpenGL 1.1.2 for Solaris 64-Bit applications on the Creator/Creator3D accelerator. 

                 SUNWffbgx
                 SUNWffbgl
                 SUNWglrt
                 SUNWglrtu
                 SUNWglrtx

The following five packages are required to run Sun OpenGL 1.1.2 for Solaris 64-Bit applications on the Elite3D accelerator. 

                  SUNWafbgx
                  SUNWafbgl
                  SUNWglrt
                  SUNWglrtu
                  SUNWglrtx


8. How can I find out the release version number of OpenGL library I am using? 

      1)  pkginfo -l SUNWglrt
                PKGINST:  SUNWglrt
                   NAME:  Sun OpenGL for Solaris Runtime Libraries
               CATEGORY:  application
                   ARCH:  sparc
                VERSION:  1.2,REV=1999.07.13
                BASEDIR:  /usr
                 VENDOR:  Sun Microsystems, Inc.
                   DESC:  Sun OpenGL 1.2 for Solaris Runtime Libraries
                 PSTAMP:  mimic990713042855
               INSTDATE:  Oct 21 1999 13:53
                HOTLINE:  Please contact your local service provider
                  FILES:     36 installed pathnames
                             12 shared pathnames
                             13 directories
                             11 executables
                             26454 blocks used (approx)


    2) Programmatically, by calling glGetString(GL_VERSION) 
                 (see glGetString man page for more details) 

    3) Running the Sun OpenGL for Solaris install_check demo program: 

              % /usr/openwin/demo/GL/ogl_install_check
              

9. How come my glVertex*(), glNormal*(), etc. calls don't show in dbx()? 

   To use dbx() or SLI successfully on Sun OpenGL for Solaris application developers will need to recompile their application, using the
   -DSUN_OGL_NO_VERTEX_MACROS compilation flag. 

   Without the SUN_OGL_NO_VERTEX_MACRO compilation flag, all calls to glVertex*(), glNormal*(), glColor*(), glIndex*() and glTexCoord*()
   will be translated into internal, performance-enhanced routines. These function calls will NOT show up when dbx() is used, or when
   performing SLI-related interposing of OpenGL for Solaris applications. 


10. Can I run a program that uses the OpenGL 1.0 extensions? 

    Yes, with some caveats. Several OpenGL 1.0 Extensions, defined by other OpenGL vendors, were incorporated into the default OpenGL
    version 1.1 (and later) specification. The extension API bindings may have changed since OpenGL 1.0. 

    Refer to: OpenGL Architecture Review Board or to OpenGL Specification, for details on the OpenGL ARB and the OpenGL Specification,
    respectively.. 


11. What come my stereo application doesn't come up in stereo? 

     If you aren't running the windows system in stereo then the stereo buffers can't be accessed by applications running in the windows system.

     To set up your Creator3D for stereo: 

           1) Exit the window system
           2) Run "ffbconfig -res stereo"
           3) Restart the window system

      To set up your Elite3D for stereo: 

            1) Exit the window system
            2) Run "afbconfig -res stereo"
            3) Restart the window system

      Now any program using stereo buffers can take advantage of the Creator3D/Elite3D stereo hardware buffers. 

      Various vendors supply the hardware necessary for viewing stereo images, including StereoGraphics, who make low-end and high-end
      stereo glasses. For more information: For more information, contact: StereoGraphics Corp

      StereoGraphics Corporation 
      2171 E. Francisco Blvd 
      San Rafael CA 94901 USA 
      Phone: (415) 459-4500 
      Phone2: (800) 783-2660 
      Fax: (415) 459-3020 


12. What is the maximum number of GLX windows that can be used simultaneously? 

     Each window that is created and to which is attached a GLX context uses a file descriptor for DGA (Direct Graphics Access) information.
     The per-process maximum number of open file descriptors can be found, and changed, using the "limit" command: 

             % limit descriptors
             descriptors     64

      This implies you have up to 64 direct GLX contexts (assuming you have no other things going in that process that use up file descriptors). 

      This limit can be increased as follows: 

              % limit descriptors 128

       This will up the number of file descriptors available for use DGA and other uses to 128. The sysdef(1M) command will tell you what the
       maximum number of file descriptors (among other things) is. 

       In addition to the limit on descriptors, there is a limit on the number of hardware double buffered windows. On Creator 3D/Elite3D, you have
       up to 32 double buffered windows, beyond that OpenGL defaults to single bufffered mode. 

13. When using XtAppCreateShell to initialize the toplevel widget, we receive the following error message: "GLwMDrawingArea: requested visual
      not supported" 

      This failure is generated because there is no OpenGL-capable visual that meets the application selected visual criteria. In particular, the
      error will be reported if the application asked for a single-buffered visual (which is default mode) on systems with Creator3D. This is because
      on Creator3D/Elite3D, all OpenGL visuals are double-buffered visuals. 

      You can instruct GL widgets to pick a double-buffered visual by specifying GLwNdoublebuffer attribute in the GLwCreateMDrawArea arglist.
      For example: 

        /* Create a double buffer widget, in RGB mode,  */ 
        /* and manage it  */
        count = 0;
        XtSetArg(args[count], GLwNrgba, TRUE ); count++;
        XtSetArg(args[count], GLwNdepthSize, 23 ); count++;
        XtSetArg(args[count], GLwNallocateBackground, TRUE ); count++;
        XtSetArg(args[count], GLwNdoublebuffer, TRUE ); count++;
                   
         glW = GLwCreateMDrawingArea( frame, "glW", args, count );
         

14. How do I emulate single buffer behavior using double-buffered visuals? 

    You can simulate single buffer behavior using double-buffered context by calling glDrawBuffer (GL_FRONT) and avoiding calls to
    glXSwapBuffers. 


15. How can I use OpenGL with overlay? 

  Rendering to an Overlay visual is supported in OpenGL for Solaris. 

  Examples showing the usage of OpenGL rendering to an overlay window are included in OpenGL for Solaris product. If you installed the
  SUNWgleg package from the OpenGL for Graphics@Sun distribution to the default installed location, the overlay examples can be found in: 
  /usr/openwin/share/src/GL/contrib/examples/sun/overlay. 

  Depending on the version of Solaris, overlay visuals may not be present 
  by default, but it can be enabled by running the following (as root): 

      For Creator 3D 

          # /usr/sbin/ffbconfig -expvis enable -sov enable

      For Elite 3D 

                    
         # /usr/sbin/afbconfig -expvis enable -sov enable 

                 You need to restart the window sytem after issuing the above command. 
                 You can verify if the presence of a GL-capable overlay visual by running: 

                     % /usr/openwin/demo/GL/xglinfo | grep OVERLAY

                 If it returns something like: 

                    OVERLAY(1) SINGLE buffered MONO COLOR INDEX visual   GL Sizes: ColorIndex=8, 

                 that means your system has a GL-capable overlay visual and you should be 
                 able to Sun ogl_overlay examples. 


16. Using OpenGL and C++ 


          Any C++ application linking to the OpenGL library, should be compiled with the -mt compilation flag. Starting with OpenGL 1.1.1 for Solaris,
          OpenGL is delivered as an MT-hot library. The change to MT-hot requires the usage of the -mt compilation flag. So, to assure forward
          compatibility with OpenGL 1.1.1 for Solaris and subsequent releases, all C++ OpenGL applications should begin using this flag. 

          MT-safe: applications can use multithreaded function calls 
          MT-hot : functions spawn threads taking advantage of multiple processors to improve functional performance. 


17. My OpenGL application seems kind of slow. What I can do? 

          The performance problems may be due to: 

               1) Running in indirect mode
               2) Using an unaccelerated feature

          Whenever possible, OpenGL renders directly to the frame buffer bypassing the X server. This is enabled by Sun's Direct Graphics
          Access(DGA) mechanism for locking portions of the screen. However, a solaris security feature allows only the user who originally logged in
          to the window system to use DGA to lock portions of the screen. Non-owners of the window system do not have access to DGA. 

          If you notice poor performance when rendering locally, the cause may be this Solaris security feature. For example, if you start the window
          system and another user at the workstation changes to the user's own environment using su, the application will not run via DGA even
          though the second user is running the application locally. 

            Run 

                % /usr/openwin/demo/GL/ogl_install_check


          If the OpenGL GLX Server status report from the program says GLX context is indirect, the login permissions need to be edited to enable
          DGA access for all users. 

           As super-user, edit permissions to allow world read/write access to the following devices: 

            # chmod 666 /dev/mouse /dev/kbd /dev/sound/* /dev/fbs/*


           This will enable access by all users for the duration of the current window system session. 

           Edit the /etc/logindevperm file and change the default permissions of all of the devices listed in the file to 0666 to allow world read/write
           access. 

           For example, the following lines in logindevperm, the 0600 should be changed to 0666 so that the next time you log in and restart the
           window system, it will be accessible by all users. 

                /dev/console    0600    /dev/mouse:/dev/kbd
                /dev/console    0600    /dev/sound/*    #audio devices
                /dev/console    0600    /dev/fbs/*      # frame buffers

           NOTE: Doing the above, will make your system no longer secure. 

           If you are running in direct mode and still see slow performance. You may be using an unaccelerated feature. For best performance: 

            1) Use display list or vertex array whenever possible. 
            2) Use consistent data types between glBegin/glEnd pair. 
            3) Avoid unneccesary use of "compute intensive " attributes; such as lighting, user clip planes, anti-aliasing, texturing, blending, etc. 

            Refer to Chapter 3 of the OpenGL for Solaris Implementation and Performance Guide for more details. 

                    Implementation and Performance Guide 

18. Performance Tip: Rescale Normal 

     Using GL_RESCALE_NORMAL_EXT instead of GL_NORMALIZE can increase application performance significantly. GL_NORMALIZE tells
     OpenGL to normalize vertex normals after the transform stage. This requires a square root plus several multiplies and divides. 

     If the normals are already unit length before being transformed, using GL_RESCALE_NORMAL_EXT tells OpenGL to correct the
     transformation matrix used for normals so that the normal lengths are preserved without additional computation. 


19. How can I obtain the list of OpenGL packages installed? 

         % pkginfo | grep OpenGL
         application SUNWafbgl
                            Sun OpenGL for Solaris Elite3D Support
          application SUNWafbgx
                            Sun OpenGL for Solaris 64-bit Elite3D Support
          application SUNWffbgl
                            Sun OpenGL for Solaris Creator Graphics (FFB) Support
          application SUNWffbgx
                            Sun OpenGL for Solaris 64-bit Creator Graphics (FFB) Support
          application SUNWgldoc
                            Sun OpenGL for Solaris Documentation and Man Pages
          application SUNWgleg
                           Sun OpenGL for Solaris Utilities and Example Programs
          application SUNWglh
                            Sun OpenGL for Solaris Header Files
          application SUNWglrt
                            Sun OpenGL for Solaris Runtime Libraries
          application SUNWglrtu
                             Sun OpenGL for Solaris Platform Specific Runtime Libs
          application SUNWglrtx
                              Sun OpenGL for Solaris 64-bit Runtime Libraries



20. Can I use OpenGL if I mount /usr/openwin? 

         Yes, you can use OpenGL with a mounted /usr/openwin provided the opengl packages are installed in the system from which you mount
         /usr/openwin. If your LD_LIBRARY_PATH is set only to /usr/lib (default), then you need to create the following links to use OpenGL. 

                    # cd /usr/lib
         # ln -s /usr/openwin/lib/libGL.so.1 libGL.so.1
         # ln -s libGL.so.1 libGL.so
         # ln -s /usr/openwin/lib/libGLU.so.1 libGLU.so.1
         # ln -s libGLU.so.1 libGLU.so
         # ln -s /usr/openwin/lib/libGLw.so.1 libGLw.so.1
         # ln -s libGLw.so.1 libGLw.so

          If you are using 64-bit libraries, then change all lib references to lib/sparcv9. 


21. Why does ps(1) show my OpenGL application using so much space? 

          The large size being reported is attributable to the portion of the address space being mapped to the frame buffer. Note that address space
          which is mapped to frame buffer does not consume workstation RAM. 
                 
                 
                 
22. Where can I download opengl
             
          http://www.sun.com/software/graphics/OpenGL/
             
23.what are the System Requirements for Sun OpenGL?
             
        Platform 
              
        UltraSPARC- and SPARC-based systems using the TCX, SX, GX, ZX, PGX, Creator and Elite3D
        family of framebuffers. 
             
        Operating System 
 
           Solaris 2.5.1, Solaris 2.6, Solaris 7, or Solaris 8 operating environments; Solaris 7 or Solaris 8 is recommended. 

            Recommended System Software Patches 

             To run OpenGL on the PGX graphics available in the Ultra 5 and Ultra 10 systems, install one of the following patches: 

             Solaris 2.5.1 :
                           patch 103792-19 (or later)
             Solaris 2.6 :
                           patch 105362-19 (or later)
             solaris 2.7:
                          patch 106146-13 9or later)

          For systems equipped with Elite3D graphics accelerator, install the following patches: 

              Solaris 2.5.1 :
                           patch 105791-16 (or later)
              Solaris 2.6 :
                           patch 105363-18 (or later)
               Solaris 7 :
                           patch 106148-03 and patch 106144-05
                           (or later)

 
             Window System 

                  CDE or OpenWindows 

              Disk Space for End-Users Runtimes 

                   32 MB for 32-Bit, 55 MB for 64-Bit 

              Disk Space for ISV Development 

                   54 MB for 32-Bit, 77 MB for 64-Bit (total to build examples) 

                 Memory 

                          64 MB minimum requirement; 128 MB or greater recommended 
   
   


                The customer just upgraded his system from Solaris 2.5.1 to Solaris 2.6 using
                the upgrade script and did not do a reinstall of the OS.

                Now when he runs /usr/openwin/demo/GL/ogl_install_check, it fails with the
                following message:

                      cannot find GLX visual 


         SOLUTION SUMMARY:

             The problem is that the default values for the OpenGL Expansion is not modified
             during the upgrade to reflect the changes expected by Solaris 2.6.

             The default settings are:
             2.5.1      OpenGL Visual Expanion    disabled
             2.6, 2.7   OpenGL Visual Expanion    enabled

            After doing the upgrade to Solaris 2.6 the OpenGL Visual Expansion value is
            still defaulting to 'disabled' and needs to be 'enabled'

            To enable the OpenGL Visual Expansion do the following command as root:

	         ffbconfig -expvis enable

		            or

	         afbconfig -expvis enable (depending the framebuffer type)
	         
	         
	         
	         
	         
	         
               
SUBMITTER: Sravanthi Methukupally APPLIES TO: Operating Systems, Operating Systems/Solaris, Operating Systems/Solaris/Solaris 2.x, Graphics, Graphics/OpenGL ATTACHMENTS:


Copyright (c) 1997-2003 Sun Microsystems, Inc.