Hi Andreas On 12 September 2013 01:08, Andreas Kloeckner <[email protected]>wrote:
> Hi Nathaniel, > > Nathaniel Virgo <[email protected]> writes: > > However, I'm unable to get the GLInterop example to work. Running it > > produces the following output. (The ApplePersistenceIgnoreState is > > irrelevant, it happens whenever I open any kind of window from Python.) > > > > $ python GlInterop.py > > Hit ESC key to quit, 'a' to toggle animation, and 'e' to toggle cuda > > 2013-09-11 14:36:53.321 Python[3027:f07] ApplePersistenceIgnoreState: > > Existing state will not be touched. New state will be written to > > > /var/folders/0x/25_70mj17tb1ypm1c_js8jd40000gq/T/org.python.python.savedState > > Traceback (most recent call last): > > File "GlInterop.py", line 135, in display > > process_image() > > File "GlInterop.py", line 170, in process_image > > glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, long(source_pbo)) > > NameError: global name 'GL_PIXEL_PACK_BUFFER_ARB' is not defined > > > > Do I have the wrong version of OpenGL, or is there something special I > can > > do to make GL_PIXEL_PACK_BUFFER_ARB work? I tried to find out where it is > > defined, and what OpenGL version it's in, but I didn't have much luck. > > > > If I can't fix this, does it mean I can't use OpenGL interop at all, or > is > > the problem specific to this example? I will be using PyCUDA for > > simulations, and I'd like to visualise the results using shared textures. > > That symbol seems to be defined in the ARB_pixel_buffer_object. Whoever > compiled your version of PyOpenGL doesn't seem to have included support > for that extension. Where did you get your PyOpenGL? What version? > It's the package py27-opengl supplied by MacPorts. MacPorts gives the version as 3.0.2_0. I noticed that the GlInterop.py example had a line from OpenGL.GL.ARB.vertex_buffer_object import * but not from OpenGL.GL.ARB.pixel_buffer_object import * so I added the latter and that seems to solve that problem, but it gets stuck at a different point: $ python GlInterop.py Hit ESC key to quit, 'a' to toggle animation, and 'e' to toggle cuda Traceback (most recent call last): File "GlInterop.py", line 136, in display process_image() File "GlInterop.py", line 176, in process_image rawgl.glReadPixels( AttributeError: 'module' object has no attribute 'glReadPixels' I noticed that on my system there is a glReadPixels defined in OpenGL.raw.GL.VERSION.GL_1_1 , but if I change the import to use that instead, I get this error message: $ python GlInterop.py Hit ESC key to quit, 'a' to toggle animation, and 'e' to toggle cuda Traceback (most recent call last): File "GlInterop.py", line 136, in display process_image() File "GlInterop.py", line 188, in process_image process(image_width, image_height) File "GlInterop.py", line 154, in process dest_mapping.device_ptr()) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.8-x86_64.egg/pycuda/driver.py", line 429, in function_prepared_call func.param_set_texref(texref) ArgumentError: Python argument types in Function.param_set_texref(Function, int) did not match C++ signature: param_set_texref(pycuda::function {lvalue}, pycuda::texture_reference) I stopped there because I'm a bit out of my depth. Do you think this example can work with this version of PyOpenGL? Nathaniel -- Nathaniel Virgo http://nathanielvirgo.com
_______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
