Thread: [PyOpenGL-Users] Works on OSX, fails on Linux
Brought to you by:
mcfletch
|
From: Derakon <de...@gm...> - 2011-05-23 18:41:45
|
I'm trying to port a program from OSX to Linux, so it can be run over an SSH tunnel. I'm getting "invalid operation" errors when I call glTexSubImage2D, though. I've trimmed the program down to a more-or-less minimal program (still almost 200 lines) which still exhibits the failure: http://paste.ubuntu.com/611982/ Dependencies are PyOpenGL, numpy, and wx. I apologize for the very inconsistent code style/formatting; this is a bit of a hodgepodge and I'm cleaning it up as I get the chance. I've pasted the error I'm getting at the end of this message. It's occurring in some PyOpenGL-accelerate code. From my understanding, this package isn't actually necessary; it just makes certain operations faster. Is it possible to uninstall it? Googling around doesn't show it being particularly straightforward to uninstall Python packages, but perhaps this one's more self-contained? Could it be that running over ssh -Y is what's giving me trouble? I'm not really familiar with SSH tunneling in general and what it does to the display. Before I started trimming down the program to make the "minimal" version, I was actually semi-randomly getting assertion errors in /usr/lib/libxcb-xlib.so (and when the assertions didn't show up the app would just hang with nothing displayed). Anyway, here's the error. Any advice would be appreciated. Thanks! Traceback (most recent call last): File "editor.py", line 159, in OnPaint image.refresh() File "editor.py", line 52, in refresh GL.GL_LUMINANCE, GL.GL_SHORT, imgString) File "latebind.pyx", line 32, in OpenGL_accelerate.latebind.LateBind.__call__ (src/latebind.c:559) File "wrapper.pyx", line 315, in OpenGL_accelerate.wrapper.Wrapper.__call__ (src/wrapper.c:5196) OpenGL.error.GLError: GLError( err = 1282, description = 'invalid operation', baseOperation = glTexSubImage2D, pyArgs = ( GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_LUMINANCE, GL_SHORT, '\x00\x00\x01\x00\x02\x00\x03\x00\x04..., ), cArgs = ( GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_LUMINANCE, GL_SHORT, '\x00\x00\x01\x00\x02\x00\x03\x00\x04..., ), cArguments = ( GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_LUMINANCE, GL_SHORT, '\x00\x00\x01\x00\x02\x00\x03\x00\x04..., ) ) |
|
From: Mike C. F. <mcf...@vr...> - 2011-05-23 19:04:20
|
On 11-05-23 02:41 PM, Derakon wrote: > I'm trying to port a program from OSX to Linux, so it can be run over > an SSH tunnel. I'm getting "invalid operation" errors when I call > glTexSubImage2D, though. I've trimmed the program down to a > more-or-less minimal program (still almost 200 lines) which still > exhibits the failure: I'm pretty sure the problem is that you haven't properly bound your texture for the refresh and as a result you are seeing an error due to e.g. alignment or similar issues pushing your image parameters into invalid territory. I come to that conclusion by adding a self.bindtexture() to your image class' refresh method, which eliminates the errors and displays some gradients. This kind of thing is common in cross-platform OpenGL, one implementation happens to allow it, another is more strict about the order of operations. Linux, in particular, has become far more stringent in recent years as to order of operations. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
|
From: Alejandro S. <as...@gm...> - 2011-05-23 19:22:45
|
Hi Derakon, On Mon, May 23, 2011 at 4:04 PM, Mike C. Fletcher <mcf...@vr...>wrote: > I'm pretty sure the problem is that you haven't properly bound your > texture for the refresh and as a result you are seeing an error due to > e.g. alignment or similar issues pushing your image parameters into > invalid territory. I subscribe to Mike's comments. In line 159 you are forgetting to call image.bindTexture() before calling image.refresh(). This might not be what you intended. Good luck, Alejandro.- -- http://alejandrosegovia.net |
|
From: Alejandro S. <as...@gm...> - 2011-05-23 19:42:30
|
Forwarding to PyOpenGL Users on behalf of Derakon ;) Alejandro.- ---------- Forwarded message ---------- From: Derakon <de...@gm...> Date: Mon, May 23, 2011 at 4:30 PM Subject: Re: [PyOpenGL-Users] Works on OSX, fails on Linux To: Alejandro Segovia <as...@gm...> On Mon, May 23, 2011 at 12:22 PM, Alejandro Segovia <as...@gm...> wrote: > Hi Derakon, > On Mon, May 23, 2011 at 4:04 PM, Mike C. Fletcher <mcf...@vr...> > wrote: >> >> I'm pretty sure the problem is that you haven't properly bound your >> texture for the refresh and as a result you are seeing an error due to >> e.g. alignment or similar issues pushing your image parameters into >> invalid territory. > > I subscribe to Mike's comments. In line 159 you are forgetting to call > image.bindTexture() before calling image.refresh(). This might not be what > you intended. Yeah, this was the fix. Thanks, guys! I found that the the assertion errors I was getting earlier had something to do with my multithreaded viewer-update code. In normal use the program has three separate windows showing different views of a dataset; when the dataset updates I have to update all three viewers, which I was doing in three separate threads. I guess something about that isn't quite threadsafe, since while it worked fine on OSX I had to revert to a sequential update for the Linux port. Anyway, it's working now! -Chris -- http://alejandrosegovia.net |