x11 wgpuSurfaceConfigure: Validation Error, Not enough memory left
Related: #688
Hi Almar! It was nice to quasi-meet you today! I'd love to sit down for a chat about WGPU/Pygfx soon as I'm starting to use and learn more about it, I think it's incredibly impressive work!
I'm trying to roll a fastplotlib widget out to users on older Ubuntu systems. For some this is the only machine they have access to and it's heavily used, so before I ask the admin to install or update drivers, I really want to make sure I know exactly what the problem is and what needs to be done.
This widget is working on jupyter, and offscreen tests with Vulkan are working, so it seems to me specifically a problem with configuring the canvas during window creation.
Reproducible example
I am testing with two scripts, one to enumerate devices and make an image widget, another to attempt creating a Qt canvas because I have other Qt applications that open on the sever (e.g. the suite2p gui and napari).
1. Test surface creation
import os
# The result is the same no matter what values are entered here. Vulkan worked offscreen
#os.environ['WGPU_BACKEND_TYPE'] = 'Vulkan'
#os.environ['RENDERCANVAS_BACKEND'] = 'qt'
import numpy as np
import wgpu
import fastplotlib as fpl
adapters = wgpu.gpu.enumerate_adapters_sync()
print(f"Found {len(adapters)} adapters\n")
for idx, adapter in enumerate(adapters):
info = adapter.info
print(f"[{idx}] {info.get('device')} ({info.get('backend_type')})")
try:
device = adapter.request_device_sync()
limits = device.limits
print(f" max-texture-2d: {limits.get('max-texture-dimension-2d')}")
except Exception as e:
print(f" ERROR: {e}")
data = np.random.rand(10, 512, 512).astype(np.float32)
iw = fpl.ImageWidget(data=data, histogram_widget=True)
iw.show()
fpl.loop.run()
Result:
foconnell@v-gpu2:~/repos/mbo_utilities$ RUST_BACKTRACE=full uv run tests/test_surface_creation.py
Unable to find extension: VK_EXT_physical_device_drm
libEGL warning: egl: failed to create dri2 screen
libEGL warning: DRI2: failed to get drm magic
Found 6 adapters
[0] NVIDIA TITAN V (Vulkan)
max-texture-2d: 32768
[1] llvmpipe (LLVM 15.0.7, 256 bits) (Vulkan)
max-texture-2d: 16384
[2] NVIDIA GeForce RTX 3090 Ti (Vulkan)
max-texture-2d: 32768
[3] NVIDIA TITAN V (Vulkan)
max-texture-2d: 32768
[4] NVIDIA TITAN V (Vulkan)
max-texture-2d: 32768
[5] llvmpipe (LLVM 15.0.7, 256 bits) (OpenGL)
max-texture-2d: 16384
Testing ImageWidget...
thread '<unnamed>' panicked at src/lib.rs:606:5:
Error in wgpuSurfaceConfigure: Validation Error
Caused by:
Not enough memory left.
stack backtrace:
0: 0x7f172ad28ba2 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hdcfcb6d4c8489523
1: 0x7f172ad4a293 - core::fmt::write::h8a494366950f23bb
2: 0x7f172ad26953 - std::io::Write::write_fmt::h6556609fca33d0b1
3: 0x7f172ad289f2 - std::sys::backtrace::BacktraceLock::print::hb2a626a81e06b2dc
4: 0x7f172ad29a93 - std::panicking::default_hook::{{closure}}::h4f78485264f12d10
5: 0x7f172ad29875 - std::panicking::default_hook::h2c66fc99e962531d
6: 0x7f172ad2a4a5 - std::panicking::rust_panic_with_hook::h33ac55f64bbd807d
7: 0x7f172ad2a23a - std::panicking::begin_panic_handler::{{closure}}::h30e7cb89678a57fe
8: 0x7f172ad290a9 - std::sys::backtrace::__rust_end_short_backtrace::hed60f27456c16ced
9: 0x7f172ad29ecd - __rustc[de2ca18b4c54d5b8]::rust_begin_unwind
10: 0x7f172ad47c50 - core::panicking::panic_fmt::h62f63d096dd276af
11: 0x7f172a8539b6 - wgpu_native::handle_error_fatal::h25a3665c7d3e2579
12: 0x7f172a869679 - wgpuSurfaceConfigure
13: 0x7f17321dc052 - ffi_call_unix64
14: 0x7f17321da9bd - ffi_call_int
15: 0x7f17321dab38 - cffistatic_ffi_call
16: 0x7f17321c262c - cdata_call
17: 0x1620bd8 - _PyEval_EvalFrameDefault
18: 0x1611cd0 - method_vectorcall.llvm.2544469730125712706
19: 0x162437e - _PyEval_EvalFrameDefault
20: 0x1611cd0 - method_vectorcall.llvm.2544469730125712706
21: 0x162437e - _PyEval_EvalFrameDefault
22: 0x164bb5c - slot_tp_init
23: 0x16027a3 - type_call
24: 0x161497a - _PyEval_EvalFrameDefault
25: 0x164bc6f - slot_tp_init
26: 0x16027a3 - type_call
27: 0x1620bd8 - _PyEval_EvalFrameDefault
28: 0x164bc6f - slot_tp_init
29: 0x16027a3 - type_call
30: 0x161497a - _PyEval_EvalFrameDefault
31: 0x16996e2 - PyEval_EvalCode
32: 0x16b3e82 - run_mod.llvm.11839558314017990275
33: 0x17c005d - pyrun_file
34: 0x17bfdec - _PyRun_SimpleFileObject
35: 0x17bfcc2 - _PyRun_AnyFileObject
36: 0x17bfc04 - pymain_run_file_obj
37: 0x17bfb18 - pymain_run_file
38: 0x17558fb - Py_RunMain
39: 0x17dcd3a - pymain_main.llvm.11357162329980987376
40: 0x17dcb2d - main
41: 0x7f17b1c29d90 - __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
42: 0x7f17b1c29e40 - __libc_start_main_impl
at ./csu/../csu/libc-start.c:392:3
43: 0x17bb1ad - _start
44: 0x0 - <unknown>
fatal runtime error: failed to initiate panic, error 5, aborting
2. Create Qt surface
import os
import wgpu
adapter = wgpu.gpu.request_adapter_sync(power_preference="high-performance")
print(f" Request adapter sync: {adapter.info.get('device')}")
device = adapter.request_device_sync()
print(" Device created successfully: \n {device}")
print("\nCreate Qt canvas")
try:
from qtpy import QtWidgets
import sys
from rendercanvas.qt import QRenderCanvas
print("Creating app")
app = QtWidgets.QApplication(sys.argv)
print(" Qt app created")
print("Creating canvas")
canvas = QRenderCanvas(size=(800, 600), title="Test")
print(" Qt canvas created")
print("Retrieve wgpu context")
present_context = canvas.get_wgpu_context()
print(f" Context: {present_context}")
print("\nConfigure context")
render_texture_format = present_context.get_preferred_format(adapter)
present_context.configure(device=device, format=render_texture_format)
print(" Context configured")
except Exception as e:
print(f"\nFailed with error: {e}")
import traceback
traceback.print_exc()
foconnell@v-gpu2:~/repos/mbo_utilities$ RUST_BACKTRACE=full uv run tests/test_minimal_surface.py
Unable to find extension: VK_EXT_physical_device_drm
libEGL warning: egl: failed to create dri2 screen
libEGL warning: DRI2: failed to get drm magic
Request adapter sync: NVIDIA TITAN V
Device created successfully:
{device}
Create Qt canvas
Creating app
Qt app created
Creating canvas
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: nouveau
libGL error: failed to get magic
libGL error: failed to load driver: nouveau
Qt canvas created
Retrieve wgpu context
Context: <rendercanvas.contexts.WgpuContextToScreen object at 0x7f4674a90fe0>
Configure context
thread '<unnamed>' panicked at src/lib.rs:606:5:
Error in wgpuSurfaceConfigure: Validation Error
Caused by:
Not enough memory left.
stack backtrace:
0: 0x7f4674728ba2 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hdcfcb6d4c8489523
1: 0x7f467474a293 - core::fmt::write::h8a494366950f23bb
2: 0x7f4674726953 - std::io::Write::write_fmt::h6556609fca33d0b1
3: 0x7f46747289f2 - std::sys::backtrace::BacktraceLock::print::hb2a626a81e06b2dc
4: 0x7f4674729a93 - std::panicking::default_hook::{{closure}}::h4f78485264f12d10
5: 0x7f4674729875 - std::panicking::default_hook::h2c66fc99e962531d
6: 0x7f467472a4a5 - std::panicking::rust_panic_with_hook::h33ac55f64bbd807d
7: 0x7f467472a23a - std::panicking::begin_panic_handler::{{closure}}::h30e7cb89678a57fe
8: 0x7f46747290a9 - std::sys::backtrace::__rust_end_short_backtrace::hed60f27456c16ced
9: 0x7f4674729ecd - __rustc[de2ca18b4c54d5b8]::rust_begin_unwind
10: 0x7f4674747c50 - core::panicking::panic_fmt::h62f63d096dd276af
11: 0x7f46742539b6 - wgpu_native::handle_error_fatal::h25a3665c7d3e2579
12: 0x7f4674269679 - wgpuSurfaceConfigure
13: 0x7f46759ae052 - ffi_call_unix64
14: 0x7f46759ac9bd - ffi_call_int
15: 0x7f46759acb38 - cffistatic_ffi_call
16: 0x7f467599462c - cdata_call
17: 0x1620bd8 - _PyEval_EvalFrameDefault
18: 0x1611cd0 - method_vectorcall.llvm.2544469730125712706
19: 0x162437e - _PyEval_EvalFrameDefault
20: 0x1611cd0 - method_vectorcall.llvm.2544469730125712706
21: 0x162437e - _PyEval_EvalFrameDefault
22: 0x16996e2 - PyEval_EvalCode
23: 0x16b3e82 - run_mod.llvm.11839558314017990275
24: 0x17c005d - pyrun_file
25: 0x17bfdec - _PyRun_SimpleFileObject
26: 0x17bfcc2 - _PyRun_AnyFileObject
27: 0x17bfc04 - pymain_run_file_obj
28: 0x17bfb18 - pymain_run_file
29: 0x17558fb - Py_RunMain
30: 0x17dcd3a - pymain_main.llvm.11357162329980987376
31: 0x17dcb2d - main
32: 0x7f4675a29d90 - __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
33: 0x7f4675a29e40 - __libc_start_main_impl
at ./csu/../csu/libc-start.c:392:3
34: 0x17bb1ad - _start
35: 0x0 - <unknown>
fatal runtime error: failed to initiate panic, error 5, aborting
I was first getting a generic surface creation threads panic error alone, I then asked the admin of this system to add me to the render and video user groups. Only then I received the memory error above.
Also note: I get the VK_EXT errors, and libEGL errors even when successfully opening napari.
Environment
GPU
foconnell@v-gpu2:~/repos/mbo_utilities$ nvidia-smi
Thu Nov 20 11:29:12 2025
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.23.06 Driver Version: 545.23.06 CUDA Version: 12.3 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA TITAN V On | 00000000:18:00.0 Off | N/A |
| 28% 41C P2 29W / 250W | 90MiB / 12288MiB | 17% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
| 1 NVIDIA TITAN V On | 00000000:3B:00.0 Off | N/A |
| 28% 39C P8 25W / 250W | 5MiB / 12288MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
| 2 NVIDIA GeForce RTX 3090 Ti On | 00000000:5E:00.0 Off | Off |
| 0% 29C P8 19W / 450W | 127MiB / 24564MiB | 12% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
| 3 NVIDIA TITAN V On | 00000000:86:00.0 Off | N/A |
| 28% 37C P8 25W / 250W | 5MiB / 12288MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 4096913 G /usr/lib/xorg/Xorg 85MiB |
| 2 N/A N/A 42373 C+G ...epos/beast_imaging/.venv/bin/python 114MiB |
+---------------------------------------------------------------------------------------+
(Relavant sectons of) WGPU Report:
██ system:
platform: Linux-6.2.0-36-generic-x86_64-with-glibc2.35
python_implementation: CPython
python: 3.12.12
██ versions:
wgpu: 0.28.1
cffi: 2.0.0
rendercanvas: 2.4.1
glfw: 2.10.0
numpy: 2.3.5
pygfx: 0.15.3
pylinalg: 0.6.8
fastplotlib: 0.5.2
██ wgpu_native_info:
expected_version: 27.0.2.0
lib_version: 27.0.2.0
lib_path: ./resources/libwgpu_native-release.so
Environment Variables
foconnell@v-gpu2:~/repos/mbo_utilities$ env
SHELL=/bin/bash
SESSION_MANAGER=local/v-gpu2:@/tmp/.ICE-unix/4097139,unix/v-gpu2:/tmp/.ICE-unix/4097139
WINDOWID=6291463
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/home/foconnell/.config/kdedefaults:/etc/xdg
LANGUAGE=
SHELL_SESSION_ID=f87a6aa5a9564b70b9fa9e26ebaa9462
GTK_RC_FILES=/etc/gtk/gtkrc:/home/foconnell/.gtkrc:/home/foconnell/.config/gtkrc
XCURSOR_SIZE=24
GTK_MODULES=gail:atk-bridge
PWD=/home/foconnell/repos/mbo_utilities
KRB5CCNAME=FILE:/tmp/krb5cc_343984073_ybsQCD
LOGNAME=foconnell
XDG_SESSION_TYPE=x11
SYSTEMD_EXEC_PID=598673
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/foconnell/.gtkrc-2.0:/home/foconnell/.config/gtkrc-2.0
HOME=/home/foconnell
LANG=en_US.UTF-8
XDG_CURRENT_DESKTOP=KDE
KONSOLE_DBUS_SERVICE=:1.4365
XRDP_SOCKET_PATH=/run/xrdp/sockdir
KONSOLE_DBUS_SESSION=/Sessions/2
PROFILEHOME=
XRDP_PULSE_SOURCE_SOCKET=xrdp_chansrv_audio_in_socket_17
KONSOLE_VERSION=211203
KDE_SESSION_UID=343984073
XDG_SESSION_CLASS=user
TERM=xterm-256color
USER=foconnell
COLORFGBG=15;0
XRDP_SESSION=1
KDE_SESSION_VERSION=5
DISPLAY=:17.0
XRDP_PULSE_SINK_SOCKET=xrdp_chansrv_audio_out_socket_17
SHLVL=1
XDG_SESSION_ID=c124
LD_LIBRARY_PATH=/usr/lib64:/usr/lib
XDG_RUNTIME_DIR=/run/user/343984073
QT_AUTO_SCREEN_SCALE_FACTOR=0
XCURSOR_THEME=breeze_cursors
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
KDE_FULL_SESSION=true
PATH=/home/foconnell/anaconda3/bin:/home/foconnell/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/343984073/bus
KDE_APPLICATIONS_AS_SCOPE=1
UID=343984073
KONSOLE_DBUS_WINDOW=/Windows/1
_=/usr/bin/env
Thanks 😃
Double checking the required linux packages:
foconnell@v-gpu2:~/repos/mbo_utilities$ dpkg -l | grep -E 'mesa-vulkan-drivers|xserver-xorg-core|libvulkan1'
ii libvulkan1:amd64 1.3.204.1-2 amd64 Vulkan loader library
ii mesa-vulkan-drivers:amd64 23.2.1-1ubuntu3.1~22.04.3 amd64 Mesa Vulkan graphics drivers
ii xserver-xorg-core 2:21.1.4-2ubuntu1.7~22.04.16 amd64 Xorg X server - core server
ii xserver-xorg-core-hwe-18.04 3:14.6 amd64 Transitional package for xserver-xorg-core-hwe-18.04
Not sure if this helps, vulkan summary and vkcube demo:
foconnell@v-gpu2:~/repos/mbo_utilities$ vulkaninfo --summary
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 1. Skipping ICD.
==========
VULKANINFO
==========
Vulkan Instance Version: 1.3.204
...some instance info omitted
Instance Layers: count = 3
--------------------------
VK_LAYER_INTEL_nullhw INTEL NULL HW 1.1.73 version 1
VK_LAYER_MESA_device_select Linux device selection layer 1.3.211 version 1
VK_LAYER_MESA_overlay Mesa Overlay layer 1.3.211 version 1
Devices:
========
GPU0:
apiVersion = 4206852 (1.3.260)
driverVersion = 2286272896 (0x8845c180)
vendorID = 0x10de
deviceID = 0x1d81
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
deviceName = NVIDIA TITAN V
driverID = DRIVER_ID_NVIDIA_PROPRIETARY
driverName = NVIDIA
driverInfo = 545.23.06
conformanceVersion = 1.3.6.0
deviceUUID = bd3ba5ff-07c5-7a44-0172-26dde958471b
driverUUID = 4dc7d163-33e4-5c19-9065-8e7dbc672099
GPU1:
apiVersion = 4206847 (1.3.255)
driverVersion = 1 (0x0001)
vendorID = 0x10005
deviceID = 0x0000
deviceType = PHYSICAL_DEVICE_TYPE_CPU
deviceName = llvmpipe (LLVM 15.0.7, 256 bits)
driverID = DRIVER_ID_MESA_LLVMPIPE
driverName = llvmpipe
driverInfo = Mesa 23.2.1-1ubuntu3.1~22.04.3 (LLVM 15.0.7)
conformanceVersion = 1.3.1.1
deviceUUID = 6d657361-3233-2e32-2e31-2d3175627500
driverUUID = 6c6c766d-7069-7065-5555-494400000000
GPU2:
apiVersion = 4206852 (1.3.260)
driverVersion = 2286272896 (0x8845c180)
vendorID = 0x10de
deviceID = 0x2203
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
deviceName = NVIDIA GeForce RTX 3090 Ti
driverID = DRIVER_ID_NVIDIA_PROPRIETARY
driverName = NVIDIA
driverInfo = 545.23.06
conformanceVersion = 1.3.6.0
deviceUUID = 83e02629-cbbb-c602-14f8-cd7f1a4cbab0
driverUUID = 4dc7d163-33e4-5c19-9065-8e7dbc672099
GPU3:
apiVersion = 4206852 (1.3.260)
driverVersion = 2286272896 (0x8845c180)
vendorID = 0x10de
deviceID = 0x1d81
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
deviceName = NVIDIA TITAN V
driverID = DRIVER_ID_NVIDIA_PROPRIETARY
driverName = NVIDIA
driverInfo = 545.23.06
conformanceVersion = 1.3.6.0
deviceUUID = bb94506b-67ab-4fc0-27d4-2c5e6c9f968f
driverUUID = 4dc7d163-33e4-5c19-9065-8e7dbc672099
GPU4:
apiVersion = 4206852 (1.3.260)
driverVersion = 2286272896 (0x8845c180)
vendorID = 0x10de
deviceID = 0x1d81
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
deviceName = NVIDIA TITAN V
driverID = DRIVER_ID_NVIDIA_PROPRIETARY
driverName = NVIDIA
driverInfo = 545.23.06
conformanceVersion = 1.3.6.0
deviceUUID = 61a50777-e113-f730-7958-1e736b70cd47
driverUUID = 4dc7d163-33e4-5c19-9065-8e7dbc672099
foconnell@v-gpu2:~/repos/mbo_utilities$ vkcube
Selected GPU 0: NVIDIA TITAN V, type: 2
Could not find both graphics and present queues
Are you able to run the triangle example?
foconnell@v-gpu2:~/repos/mbo_utilities$ uv run ../wgpu-py/examples/triangle.py
Unable to find extension: VK_EXT_physical_device_drm
libEGL warning: egl: failed to create dri2 screen
libEGL warning: DRI2: failed to get drm magic
thread '<unnamed>' panicked at src/lib.rs:606:5:
Error in wgpuSurfaceConfigure: Validation Error
Caused by:
Not enough memory left.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
run with RUST_BACKTRACE=1
foconnell@v-gpu2:~/repos/mbo_utilities$ RUST_BACKTRACE=1 uv run ../wgpu-py/examples/triangle.py
Unable to find extension: VK_EXT_physical_device_drm
libEGL warning: egl: failed to create dri2 screen
libEGL warning: DRI2: failed to get drm magic
thread '<unnamed>' panicked at src/lib.rs:606:5:
Error in wgpuSurfaceConfigure: Validation Error
Caused by:
Not enough memory left.
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: wgpu_native::handle_error_fatal
3: wgpuSurfaceConfigure
4: ffi_call_unix64
5: ffi_call_int
6: cffistatic_ffi_call
7: cdata_call
8: _PyEval_EvalFrameDefault
9: method_vectorcall.llvm.2544469730125712706
10: _PyEval_EvalFrameDefault
11: method_vectorcall.llvm.2544469730125712706
12: _PyEval_EvalFrameDefault
13: PyEval_EvalCode
14: run_mod.llvm.11839558314017990275
15: pyrun_file
16: _PyRun_SimpleFileObject
17: _PyRun_AnyFileObject
18: pymain_run_file_obj
19: pymain_run_file
20: Py_RunMain
21: pymain_main.llvm.11357162329980987376
22: main
23: __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
24: __libc_start_main_impl
at ./csu/../csu/libc-start.c:392:3
25: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5, aborting
Those EGL warnings make me want to install new drivers.
This widget is working on jupyter, and offscreen tests with Vulkan are working, so it seems to me specifically a problem with configuring the canvas during window creation.
Yes, that's likely, and a known problem on Linux. The solution would be to avoid creating a native surface, but to use an offscreen texture, which is then downloaded to RAM so it can be presented as a plain old bitmap. This is called the bitmap present-method, in rendercanvas.
In the triangle example, try changing to these lines:
from rendercanvas.pyside6 import RenderCanvas, loop # replace pyqt6/pyqt5 if applicable
canvas = RenderCanvas(size=(640, 480), title="wgpu triangle example", present_method='bitmap')
The EGL errors can likely be ignored. Internally, wgpu is enumerating all possible backends, and in that process, some backends (OpenGL in this case) can produce warnings. This can happen even when no OpenGL adapter is ever created. I expect that in time this will be fixed upstream.
libegl might be part of the vulkan ICD loader? https://download.nvidia.com/XFree86/Linux-x86_64/580.95.05/README/installedcomponents.html
GLVND vendor implementation libraries for GLX (/usr/lib/libGLX_nvidia.so.0) and EGL (/usr/lib/libEGL_nvidia.so.0); these libraries provide NVIDIA implementations of OpenGL functionality which may be accessed using the GLVND client-facing libraries.
libGLX_nvidia.so.0 and libEGL_nvidia.so.0 can be used as Vulkan ICDs. The Vulkan ICD configuration file included with the driver references libGLX_nvidia.so.0, however in environments where X11 client libraries are not available, libEGL_nvidia.so.0 should be used.
The Vulkan ICD configuration file is installed as /etc/vulkan/icd.d/nvidia_icd.json.
An additional Vulkan layer configuration file is installed as /etc/vulkan/implicit_layer.d/nvidia_layers.json. These layers add functionality to the Vulkan loader.
Do you have a physical screen attached to the GPU and you have a desktop environment running?
ok! we're cooking again!
Do you have a physical screen attached to the GPU and you have a desktop environment running?
I don't think so but can likely connect one, and yes
so the current solution is to image widget kwargs, which works for now until its fixed upstream.
figure_kwargs = {
"canvas": "pyside6",
"canvas_kwargs": {"present_method": "bitmap"},
}
iw = fpl.ImageWidget(
data,
figure_kwargs=figure_kwargs,
)
iw.show()
fpl.loop.run()
so the current solution is to image widget kwargs, which works for now until its fixed upstream.
figure_kwargs = { "canvas": "pyside6", "canvas_kwargs": {"present_method": "bitmap"}, } iw = fpl.ImageWidget( data, figure_kwargs=figure_kwargs, ) iw.show() fpl.loop.run()
I'm so confused 😂
Side note: if you set your backend (graphics API really) via the instance extras instead of the env var, and do that before enumerating devices you should be able to skip the OpenGL warnings.
See https://wgpu-py.readthedocs.io/en/stable/backends.html#wgpu.backends.wgpu_native.set_instance_extras It might even be faster, although I haven't really tested that. And this is a native only feature, meaning in pyodide this doesn't exist.
I'm so confused
To add some context, with the 'bitmap' method, the texture is downloaded first, similar to what happens with the offscreen and jupyter backends. The downloaded bitmap is then passed to the canvas for display. In this case Qt wrapping the bitmap in a QImage.
The 'bitmap' present method is not supported by all backends (glfw simply ignores the setting, we should probably error instead), but all Qt backends support it.
fixed upstream
There's a couple of paths that (can) lead to a better situation:
- Maybe some cases can be fixed upstream in wgpu-core.
- Glfw's Wayland support is also currently an issue, so upstream improvements may help too.
- I'm currently working on better async support and https://github.com/pygfx/rendercanvas/pull/138, so that the performance penalty for using 'bitmap' vs 'screen' becomes much smaller. It may then be feasible to default to 'bitmap' on Linux where possible.
- I would love to add support for native windows (https://github.com/pygfx/rendercanvas/issues/39), which will circumvent problems that glfw has, and also enable optimized bitmap present.