Skip to content

[BUG]: cudaGraphicsGLRegisterImage returns null handle with cuda-bindings 12.9.3 #1122

@pijyoi

Description

@pijyoi

Is this a duplicate?

Type of Bug

Silent Failure

Component

cuda.bindings

Describe the bug

On cuda-bindings 12.9.3, cudaGraphicsGLRegisterImage reports cudaSuccess but returns a null handle.
This does not happen with cuda-bindings 12.9.2

How to Reproduce

PySide6 is used to create the OpenGL context and texture.

from cuda.bindings import runtime as cudart
from PySide6 import QtGui, QtOpenGL

class GLWidget(QtOpenGL.QOpenGLWindow):
    def initializeGL(self):
        self.m_texture = QtOpenGL.QOpenGLTexture(QtOpenGL.QOpenGLTexture.Target.Target2D)
        self.m_texture.setFormat(QtOpenGL.QOpenGLTexture.TextureFormat.RGBA8_UNorm)
        self.m_texture.setSize(512, 512)
        self.m_texture.allocateStorage()

        err, self.gfx_resource = cudart.cudaGraphicsGLRegisterImage(
            self.m_texture.textureId(), self.m_texture.target().value,
            cudart.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard
        )
        error_name = cudart.cudaGetErrorName(err)[1].decode()
        print(error_name, self.gfx_resource)

app = QtGui.QGuiApplication([])
win = GLWidget()
win.show()

# 12.9.2: cudaSuccess <cudaGraphicsResource_t 0x1b75dca8e90>
# 12.9.3: cudaSuccess <cudaGraphicsResource_t 0x0>

Expected behavior

cudaGraphicsGLRegisterImage should return a valid handle upon cudaSuccess

Operating System

No response

nvidia-smi output

No response

Metadata

Metadata

Assignees

Labels

P0High priority - Must do!bugSomething isn't workingcuda.bindingsEverything related to the cuda.bindings module

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions