OpenGL texture to GpuMat (CUDA)?

Also, I find that if I comment out

pygame.init()
pygame.display.set_caption('Texture Receiver Example')
pygame.display.set_mode((width, height),
                        pygame.OPENGL | pygame.DOUBLEBUF)

this is the result:

Traceback (most recent call last):
  File "C:\Users\fdasfasdfasd\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\latebind.py", line 43, in __call__
    return self._finalCall( *args, **named )
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\fdasfasdfasd\Documents\test.py", line 18, in <module>
    TextureID = glGenTextures(1)
  File "C:\Users\fdasfasdfasd\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\latebind.py", line 47, in __call__
    return self._finalCall( *args, **named )
  File "C:\Users\fdasfasdfasd\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\wrapper.py", line 678, in wrapperCall
    raise err
  File "C:\Users\fdasfasdfasd\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\wrapper.py", line 671, in wrapperCall
    result = wrappedOperation( *cArguments )
  File "C:\Users\fdasfasdfasd\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\platform\baseplatform.py", line 415, in __call__
    return self( *args, **named )
  File "C:\Users\fdasfasdfasd\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\error.py", line 230, in glCheckError
    raise self._errorClass(
OpenGL.error.GLError: GLError(
        err = 1282,
        description = b'invalid operation',
        baseOperation = glGenTextures,
        pyArgs = (
                1,
                <object object at 0x000001A7A79EB0C0>,
        ),
        cArgs = (1, array([0], dtype=uint32)),
        cArguments = (1, array([0], dtype=uint32))
)

so it looks like PyGame is handling the OpenGL , could it be that it is a different OpenGL context from OpenCV?