Skip to content

cudaError_t.cudaErrorOperatingSystem #248

Closed

Description

@leviome
from cuda import cudart as cu

err, _, _ = cu.cudaGLGetDevices(1, cu.cudaGLDeviceList.cudaGLDeviceListAll)
print(err)

# cudaError_t.cudaErrorOperatingSystem

Ubuntu 20.04, RTX 4090

Activity

  1. leofang commented on Nov 21, 2024

    @leofang
    Member

    We are investigating internally.

  2. added
    triageNeeds the team's attention
    P1Medium priority - Should do
    cuda.bindingsEverything related to the cuda.bindings module
    on Nov 21, 2024
  3. vzhurba01 commented on Feb 27, 2025

    @vzhurba01
    Contributor

    Hi @leviome, I'm assuming that the code shared is just a snippet of the API call after you've already created a GL context. When I run the snippet as is, I get cudaError_t.cudaErrorInvalidGraphicsContext which seems expected since a GL context needs to be created before this call IIUC.

    However, here's what I ran to attempt a repro:

    # need to install pygame, pyopengl, cuda-python (best through conda-forge)
    import pygame as pg
    from OpenGL import EGL
    from cuda import cudart
    
    if __name__ == "__main__":
        pg.init()
        display_size = (640, 480)
        pg.display.set_mode(display_size, pg.OPENGL | pg.DOUBLEBUF | pg.RESIZABLE)
        # check opengl context is created
        assert EGL.eglGetCurrentContext() is not None
        print(cudart.cudaGLGetDevices(1, cudart.cudaGLDeviceList.cudaGLDeviceListAll))
    

    but this returns cudaError_t.cudaSuccess, implying that the bindings are working as expected. Therefore it's likely there's something happening in one of your prior calls or how your system is configured.

    If you think there're prior calls that complicate the binding of cudaGLGetDevices API, a full snippet would be helpful. Otherwise the bindings look ok, so this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1Medium priority - Should docuda.bindingsEverything related to the cuda.bindings moduletriageNeeds the team's attention

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions