[GRASS-dev] 64bit image issues (WAS: Re: grass-dev Digest, Vol 2, Issue 19)

Glynn Clements glynn at gclements.plus.com
Fri Jun 16 05:54:07 EDT 2006


Brad Douglas wrote:

> On Mon, 2006-06-12 at 12:01 +0100, Glynn Clements wrote:
> > Brad Douglas wrote:
> > 
> > > FYI, it is exiting with status 01 and I can only assume the error has
> > > nothing to do with GRASS (looks like the xorg GLX module needs work?):
> > 
> > Either that, or libGL needs work. What does glxinfo say about the
> > server's GLX version?
> 
> 1.2.
> 
> > If the server reports 1.3, it's the server's fault for claiming to
> > support GLX 1.3 then complaining about getting GLX 1.3 requests. If it
> > reports 1.2, it's the library's fault for trying to send GLX 1.3
> > requests to a server which doesn't support them.
> 
> Hmm.

Actually, even with 1.2, the server might support pbuffers as an
extension (GLX_SGIX_pbuffer? I'm not sure).

> > I suppose that the off-screen rendering code should probably have a
> > run-time mechanism to disable attempts to create a pbuffer (probably
> > for GLX Pixmaps also) in case of buggy OpenGL implementations (which,
> > unfortuntately, are quite common).
> > 
> > If DRI is in use, you could try "export LIBGL_ALWAYS_INDIRECT=1" to
> > disable it, in case the problem is with the DRI module.
> 
> Doing that makes nviz error out with a GLXBadContext, immediately.  This
> is the same problem that Hamish having.
> 
> > For now, you can manually undefine HAVE_PBUFFERS (and optionally
> > HAVE_PIXMAPS as well) in config.h before compiling NVIZ. That will
> > allow you to determine whether there are any other bugs in that code.
> 
> #undef HAVE_PBUFFERS errors with GLXBadContext on PixMap (using GLX
> 1.1).  Adding #undef HAVE_PIXMAPS makes really pretty high resolution
> PPMs. :-)

Can you try the attached patch. It adds two environment variables
(GRASS_NO_GLX_PBUFFERS and GRASS_NO_GLX_PIXMAPS) which, if set (to
anything), will disable these features.

When it comes to OpenGL, just because both the library and X server
claim to support a particular feature, that doesn't mean that it's
safe to use it.

-- 
Glynn Clements <glynn at gclements.plus.com>

-------------- next part --------------
Index: visualization/nviz/src/do_zoom.c
===================================================================
RCS file: /grassrepository/grass6/visualization/nviz/src/do_zoom.c,v
retrieving revision 2.4
diff -u -r2.4 do_zoom.c
--- visualization/nviz/src/do_zoom.c	21 May 2006 09:54:24 -0000	2.4
+++ visualization/nviz/src/do_zoom.c	16 Jun 2006 09:49:19 -0000
@@ -269,27 +269,32 @@
 
 #ifdef HAVE_PBUFFERS
 #if defined(GLX_PBUFFER_WIDTH) && defined(GLX_PBUFFER_HEIGHT)
-    fprintf(stderr, "Creating PBuffer Using GLX 1.3\n");
-
-    fbc = glXChooseFBConfig(dpy, scr, 0, &elements);
-    if (fbc)
+    if (!getenv("GRASS_NO_GLX_PBUFFERS"))
     {
-	pbuf_cnt = 0;
-	pbuf_attrib[pbuf_cnt++] = GLX_PBUFFER_WIDTH;
-	pbuf_attrib[pbuf_cnt++] = width + 1;
-	pbuf_attrib[pbuf_cnt++] = GLX_PBUFFER_HEIGHT;
-	pbuf_attrib[pbuf_cnt++] = height + 1;
+	fprintf(stderr, "Creating PBuffer Using GLX 1.3\n");
+
+	fbc = glXChooseFBConfig(dpy, scr, 0, &elements);
+	if (fbc)
+	{
+	    pbuf_cnt = 0;
+	    pbuf_attrib[pbuf_cnt++] = GLX_PBUFFER_WIDTH;
+	    pbuf_attrib[pbuf_cnt++] = width + 1;
+	    pbuf_attrib[pbuf_cnt++] = GLX_PBUFFER_HEIGHT;
+	    pbuf_attrib[pbuf_cnt++] = height + 1;
 
-	pbuffer = glXCreatePbuffer(dpy, fbc[0], pbuf_attrib);
-	if (pbuffer)
-	    glXMakeContextCurrent(dpy, pbuffer, pbuffer, ctx_orig);
+	    pbuffer = glXCreatePbuffer(dpy, fbc[0], pbuf_attrib);
+	    if (pbuffer)
+		glXMakeContextCurrent(dpy, pbuffer, pbuffer, ctx_orig);
+	}
     }
 #endif
 #endif
+
 #ifdef HAVE_PIXMAPS
 #ifdef HAVE_PBUFFERS
     if (!pbuffer)
 #endif
+    if (!getenv("GRASS_NO_GLX_PIXMAPS"))
     {
 	fprintf(stderr, "Create PixMap Using GLX 1.1\n");
 


More information about the grass-dev mailing list