Skip to content

[BUG(test only)]: test_graphics_api_smoketest failing on headless nodes #1165

@rwgk

Description

@rwgk

I keep running into the error below on colossus machines.

I have a fix that I need to extract from my CTK-next work, but logging the error here first for visibility.

=================================== FAILURES ===================================
_________________________ test_graphics_api_smoketest __________________________

self = <pyglet._ModuleProxy object at 0xef3118b30b30>, name = 'Texture'

    def __getattr__(self, name: str): # noqa: ANN204
        try:
>           return getattr(self._module, name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           AttributeError: 'NoneType' object has no attribute 'Texture'

../TestVenv/lib/python3.12/site-packages/pyglet/__init__.py:439: AttributeError

During handling of the above exception, another exception occurred:

    def test_graphics_api_smoketest():
        # Due to lazy importing in pyglet, pytest.importorskip doesn't work
        try:
            import pyglet

>           tex = pyglet.image.Texture.create(512, 512)
                  ^^^^^^^^^^^^^^^^^^^^

tests/test_graphics_apis.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../TestVenv/lib/python3.12/site-packages/pyglet/__init__.py:445: in __getattr__
    __import__(import_name)
../TestVenv/lib/python3.12/site-packages/pyglet/image/__init__.py:106: in <module>
    from pyglet.gl import (
../TestVenv/lib/python3.12/site-packages/pyglet/gl/__init__.py:205: in <module>
    import pyglet.window  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^
../TestVenv/lib/python3.12/site-packages/pyglet/window/__init__.py:1904: in <module>
    gl._create_shadow_window()  # noqa: SLF001
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
../TestVenv/lib/python3.12/site-packages/pyglet/gl/__init__.py:179: in _create_shadow_window
    _shadow_window = ShadowWindow()
                     ^^^^^^^^^^^^^^
../TestVenv/lib/python3.12/site-packages/pyglet/gl/__init__.py:168: in __init__
    super().__init__(width=1, height=1, visible=False)
../TestVenv/lib/python3.12/site-packages/pyglet/window/xlib/__init__.py:167: in __init__
    super().__init__(*args, **kwargs)
../TestVenv/lib/python3.12/site-packages/pyglet/window/__init__.py:508: in __init__
    display = pyglet.display.get_display()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../TestVenv/lib/python3.12/site-packages/pyglet/display/__init__.py:77: in get_display
    return Display()
           ^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <pyglet.display.xlib.XlibDisplay object at 0xef3118b35a30>, name = None
x_screen = 0

    def __init__(self, name=None, x_screen=None):
        self._screens = []

        if x_screen is None:
            x_screen = 0

        if isinstance(name, str):
            name = c_char_p(name.encode('ascii'))

        self._display = xlib.XOpenDisplay(name)
        if not self._display:
>           raise NoSuchDisplayException(f'Cannot connect to "{name}"')
E           pyglet.display.xlib.NoSuchDisplayException: Cannot connect to "None"

../TestVenv/lib/python3.12/site-packages/pyglet/display/xlib.py:102: NoSuchDisplayException
=========================== short test summary info ============================
FAILED tests/test_graphics_apis.py::test_graphics_api_smoketest - pyglet.display.xlib.NoSuchDisplayException: Cannot connect to "None"
=================== 1 failed, 222 passed in 94.29s (0:01:34) ===================

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcuda.bindingsEverything related to the cuda.bindings module

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions