View Single Post
Old 12-04-07, 04:48 AM   #2
Registered User
Join Date: Nov 2007
Posts: 2
Thumbs up Re: Creating many QGLWidgets causes GLXBadDrawable error in X Server

This is fixed.....

The problem, as indicated by the X Server log file, is with the default limit on number of shared memory IDs. At some point after creating some QGLWidget Windows, the system was exhausted of all shared memory IDs. Therefore X Server couldn't obtain a new shared memory ID, and it reported it in the X Server log file.

The default limit on number of shared memory IDs on Solaris seems to be 128, which is soon exhausted when we create multiple QGLWidget Windows. One QGLWidget Windows approximately consumes two shared memory IDs (-- perhaps Qt, or the X Server, or the Solaris system creates these shared memories for it's internal use).
To check the shared memory ID limit execute:

prctl -n project.max-shm-ids $$

The practical solution is to simply increase the limit of shared memory IDs. We increased the limit for "privileged resource control type" by adding the following entry to "/etc/project" file:

tcsh:> cat /etc/project

There might be other ways to increasing the limit. The above change assumes that the user is associated with a "project" named "default" (see Solaris command "prctl" for more information).

After making this change we could create at least three times more QGLWidget Windows. Increasing it to 1024, will allow nearly double that of 512, and so on.

cnsiva is offline   Reply With Quote