code: def initData(fn=None):
      global pixels, array, pbo_buffer, cuda_pbo_resource, imWidth, imHeight, texid
  
      # Cuda array initialization
      array = cuda_driver.matrix_to_array(
          pixels, "C"
      )  # C-style instead of Fortran-style: row-major
  
      pixels.fill(0)  # Resetting the array to 0
  
      pbo_buffer = glGenBuffers(1)  # generate 1 buffer reference
      glBindBuffer(
          GL_PIXEL_UNPACK_BUFFER, pbo_buffer
      )  # binding to this buffer
      glBufferData(
          GL_PIXEL_UNPACK_BUFFER,
          imWidth * imHeight,
          pixels,
          GL_STREAM_DRAW,
      )  # Allocate the buffer
      bsize = glGetBufferParameteriv(
          GL_PIXEL_UNPACK_BUFFER, GL_BUFFER_SIZE
      )  # Check allocated buffer size
      assert bsize == imWidth * imHeight
      glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)  # Unbind
  
      if ver2011:
          cuda_pbo_resource = pycuda.gl.RegisteredBuffer(
              int(pbo_buffer), cuda_gl.graphics_map_flags.WRITE_DISCARD
          )
      else:
          cuda_pbo_resource = cuda_gl.BufferObject(
              int(pbo_buffer)
          )  # Mapping GLBuffer to cuda_resource
  
      glGenTextures(1, texid)
      # generate 1 texture reference
      glBindTexture(GL_TEXTURE_2D, texid)
      # binding to this texture
      glTexImage2D(
          GL_TEXTURE_2D,
          0,
          GL_LUMINANCE,
          imWidth,
          imHeight,
          0,
          GL_LUMINANCE,
          GL_UNSIGNED_BYTE,
          None,
      )
      # Allocate the texture
      glBindTexture(GL_TEXTURE_2D, 0)  # Unbind
  
      glPixelStorei(GL_UNPACK_ALIGNMENT, 1)  # 1-byte row alignment
      glPixelStorei(GL_PACK_ALIGNMENT, 1)
  
imports: from OpenGL.GL import *
  from OpenGL.GLUT import *
  from OpenGL.GLU import *
  from OpenGL.GL.ARB.vertex_buffer_object import *
  import numpy, Image
  import sys, time, os
  import pycuda.driver
  import pycuda.gl
  import pycuda
  from pycuda.compiler import SourceModule
label_desc: Use image node_id 6 for calling a global function with example usage: initData(fn) without return types