today i decided to solve it.
I assume you are using ATI official drivers, and you have installed them yet.
Looking on the web I found a lot of infos...
1) Check your xorg.conf for:
Section "DRI"if not present add it.
Mode 0666
EndSection
2) Check your fstab.
cause running an fglx apps I got
Using GLX_SGIX_pbuffer
FGLTexMgr: open of shared memory object failed (Permission denied)
__FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!!
FGLTexMgr: open of shared memory object failed (Permission denied)
__FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!!
FGLTexMgr: open of shared memory object failed (Permission denied)
__FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!!
FGLTexMgr: open of shared memory object failed (Permission denied)
__FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!!
FGLTexMgr: open of shared memory object failed (Permission denied)
so....
add this
tmpfs /dev/shm tmpfs defaults 0 0
you can find a lot more infos here :
http://gentoo-wiki.com/HOWTO_ATI_Drivers
see ya,
Ra