Built-in GLSL Shader node throws `EGL_BAD_ATTRIBUTE` on `eglCreatePbufferSurface` (Linux / NVIDIA Wayland)
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
When passing an image through the built-in GLSL Shader node, it should successfully initialize the rendering context, compile the shader, and output the processed image.
### Actual Behavior
The execution immediately fails and halts with an `EGL_BAD_ATTRIBUTE` error. The exception happens in `GLContext.__init__` at the `eglCreatePbufferSurface` step. This seems to occur before the shader is even compiled; it fails on setting up the offscreen rendering surface.
### Steps to Reproduce
1. Start ComfyUI on a Linux + NVIDIA (Wayland) environment using the command: `python main.py --disable-all-custom-nodes`
2. Create a minimal workflow: `Load Image` -> `GLSL Shader` -> `Preview Image`.
3. Do not modify the GLSL node; just leave the default pass-through code as-is.
4. Run the workflow.
5. The GLSL node immediately throws an exception and halts execution.
### Debug Logs
```powershell
[INFO] setup plugin alembic.autogenerate.schemas
[INFO] setup plugin alembic.autogenerate.tables
[INFO] setup plugin alembic.autogenerate.types
[INFO] setup plugin alembic.autogenerate.constraints
[INFO] setup plugin alembic.autogenerate.defaults
[INFO] setup plugin alembic.autogenerate.comments
[START] Security scan
[INFO] [ComfyUI-Manager] Using uv as Python module for pip operations.
[DONE] Security scan
** ComfyUI startup time: 2026-07-28 18:15:12.815
** Platform: Linux
** Python version: 3.13.14 (main, Jul 18 2026, 17:02:37) [Clang 22.1.3 ]
** Python executable: /home/user/ComfyUI/.venv/bin/python
** ComfyUI Path: /home/user/ComfyUI
** ComfyUI Base Folder Path: /home/user/ComfyUI
** User directory: /home/user/ComfyUI/user
** ComfyUI-Manager config path: /home/user/ComfyUI/user/__manager/config.ini
** Log path: /home/user/ComfyUI/user/comfyui.log
[INFO] [PRE] ComfyUI-Manager
[INFO] Found comfy_kitchen backend cuda: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope_split_half', 'apply_rope_split_half1', 'convrot_w4a4_linear', 'dequantize_convrot_w4a4_weight', 'dequantize_int8_convrot_weight', 'dequantize_int8_convrot_weight_dtype', 'dequantize_int8_simple', 'dequantize_int8_simple_dtype', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'gemv_awq_w4a16', 'int8_linear', 'prepare_int4_weight_for_int8_linear', 'quantize_and_rotate_rowwise', 'quantize_convrot_w4a4_weight', 'quantize_int8_convrot_weight', 'quantize_int8_rowwise', 'quantize_int8_tensorwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'rms_rope', 'rms_rope1', 'rms_rope_split_half', 'rms_rope_split_half1', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'stochastic_rounding_fp8']}
[INFO] Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope_split_half', 'apply_rope_split_half1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'int8_linear', 'quantize_and_rotate_rowwise', 'quantize_int8_rowwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
[INFO] Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope_split_half', 'apply_rope_split_half1', 'convrot_w4a4_linear', 'dequantize_convrot_w4a4_weight', 'dequantize_int8_convrot_weight', 'dequantize_int8_convrot_weight_dtype', 'dequantize_int8_simple', 'dequantize_int8_simple_dtype', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'gemv_awq_w4a16', 'int8_linear', 'prepare_int4_weight_for_int8_linear', 'quantize_and_rotate_rowwise', 'quantize_convrot_w4a4_weight', 'quantize_int8_convrot_weight', 'quantize_int8_rowwise', 'quantize_int8_tensorwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'rms_rope', 'rms_rope1', 'rms_rope_split_half', 'rms_rope_split_half1', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'stochastic_rounding_fp8']}
[INFO] Checkpoint files will always be loaded safely.
[INFO] Total VRAM 11880 MB, total RAM 32013 MB
[INFO] pytorch version: 2.13.0+cu130
[INFO] Set vram state to: NORMAL_VRAM
[INFO] Device: cuda:0 NVIDIA GeForce RTX 4070 : cudaMallocAsync
[INFO] Using async weight offloading with 2 streams
[INFO] Enabled pinned memory 28812.0
[INFO] Using pytorch attention
aimdo: /project/src-posix/cuda-funchooks.c:52:DEBUG:aimdo_setup_hooks: hooks successfully installed
aimdo: /project/src/control.c:247:INFO:comfy-aimdo inited for GPU: NVIDIA GeForce RTX 4070 (VRAM: 11879 MB)
[INFO] DynamicVRAM support detected and enabled
[INFO] Python version: 3.13.14 (main, Jul 18 2026, 17:02:37) [Clang 22.1.3 ]
[INFO] ComfyUI version: 0.28.0
[INFO] comfy-aimdo version: 0.4.10
[INFO] comfy-kitchen version: 0.2.23
[INFO] comfyui-frontend-package version: 1.47.10
[INFO] comfyui-workflow-templates version: 0.11.17
[INFO] comfyui-embedded-docs version: 0.5.9
[INFO] comfy-kitchen version: 0.2.23
[INFO] comfy-aimdo version: 0.4.10
[INFO] [Prompt Server] web root: /home/user/ComfyUI/.venv/lib/python3.13/site-packages/comfyui_frontend_package/static
[INFO] Asset seeder disabled
[INFO] [START] ComfyUI-Manager
[ComfyUI-Manager] Using GitPython backend
[INFO] [ComfyUI-Manager] network_mode: public
[WARNING] [ComfyUI-Manager] The matrix sharing feature has been disabled because the `matrix-nio` dependency is not installed.
To use this feature, please run the following command:
/home/user/ComfyUI/.venv/bin/python -m pip install matrix-nio
[INFO] No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
[INFO] Skipping loading of custom nodes
[INFO] Context impl SQLiteImpl.
[INFO] Will assume non-transactional DDL.
[INFO] Using RAM pressure cache.
[INFO] Starting server
[INFO] To see the GUI go to: http://127.0.0.1:8188
[INFO] got prompt
[ERROR] !!! Exception during processing !!! EGLError(
err = EGL_BAD_ATTRIBUTE,
baseOperation = eglCreatePbufferSurface,
cArguments = (
,
,
,
),
result =
)
[ERROR] Traceback (most recent call last):
File "/home/user/ComfyUI/execution.py", line 543, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/ComfyUI/execution.py", line 342, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/ComfyUI/execution.py", line 316, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "/home/user/ComfyUI/execution.py", line 304, in process_inputs
result = f(**inputs)
File "/home/user/ComfyUI/comfy_api/internal/__init__.py", line 149, in wrapped_func
return method(locked_class, **inputs)
File "/home/user/ComfyUI/comfy_api/latest/_io.py", line 1935, in EXECUTE_NORMALIZED
to_return = cls.execute(*args, **kwargs)
File "/home/user/ComfyUI/comfy_extras/nodes_glsl.py", line 790, in execute
all_batch_outputs = _render_shader_batch(
fragment_shader,
...<6 lines>...
curve_luts,
)
File "/home/user/ComfyUI/comfy_extras/nodes_glsl.py", line 421, in _render_shader_batch
ctx = GLContext()
File "/home/user/ComfyUI/comfy_extras/nodes_glsl.py", line 273, in __init__
self._surface = EGL.eglCreatePbufferSurface(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self._display, config,
^^^^^^^^^^^^^^^^^^^^^^
_egl_attribs(EGL.EGL_WIDTH, 64, EGL.EGL_HEIGHT, 64),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/user/ComfyUI/.venv/lib/python3.13/site-packages/OpenGL/platform/baseplatform.py", line 487,in __call__
return self(*args, **named)
File "/home/user/ComfyUI/.venv/lib/python3.13/site-packages/OpenGL/error.py", line 230, in glCheckError
raise self._errorClass(
...<4 lines>...
)
OpenGL.raw.EGL._errors.EGLError: EGLError(
err = EGL_BAD_ATTRIBUTE,
baseOperation = eglCreatePbufferSurface,
cArguments = (
,
,
,
),
result =
)
[INFO] Prompt executed in 0.22 seconds
```
### Other
**System Information:**
* **OS:** CachyOS x86_64 (Linux Kernel: 7.1.4-1-cachyos)
* **DE / WM:** KDE Plasma 6.7.3 / KWin (Wayland)
* **CPU:** AMD Ryzen 5 5600X
* **GPU:** NVIDIA GeForce RTX 4070
* **NVIDIA Driver:** 610.43.03
* **Python Version:** 3.13.14 (main, Jul 18 2026) [Clang 22.1.3]
* **PyTorch Version:** 2.13.0+cu130 (cuda:0, cudaMallocAsync)
* **ComfyUI Version:** 0.28.0
* **Core Packages:** `comfyui-frontend-package` (1.47.10), `comfy-aimdo` (0.4.10), `comfy-kitchen` (0.2.23), `comfy-angle` (0.1.0)
**Additional Troubleshooting Context:**
* My Vulkan stack is healthy. Running `vulkaninfo --summary` successfully detects the RTX 4070 and shows Vulkan API version `1.4.341` without errors.
* I attempted to force native OpenGL by running with `export ANGLE_DEFAULT_PLATFORM=gl` to bypass Vulkan, but ANGLE's internal blocklist intentionally rejects this (`"Intel or NVIDIA OpenGL ES drivers are not supported"`). The crash reported here happens when running on the default settings with no environment variables forced.
Contributor guide
Research direction
Start in comfy_extras/nodes_glsl.py, especially GLContext.__init__ at the eglCreatePbufferSurface call and _render_shader_batch. Reproduce with python main.py --disable-all-custom-nodes using the Load Image → GLSL Shader → Preview Image workflow on Linux/NVIDIA Wayland. Done means the built-in GLSL Shader node initializes and outputs the processed image without EGL_BAD_ATTRIBUTE.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100