Add Cuda OpenGL interop and use openGL 2.1 for shared memory interop.

BufferRange is openGL 3 which is still to new to be used currently.
Fixing more compilation errors.