Repository navigation
Description
Environment
Where are you using Unsloth?
- Unsloth desktop application
- Unsloth web UI (
unsloth studio) - Unsloth CLI
- Python package or notebook
- Colab or Kaggle
Operating system and version: Linux Mint 21.3 "virginia" (Ubuntu 22.04 base), kernel 6.8.0-138-generic, X11 session (no Wayland, WAYLAND_DISPLAY unset)
GPU model(s) and accelerator backend: NVIDIA GeForce RTX 3070, CUDA, driver 580.178.04 (CUDA 13.0)
Versions:
- Unsloth Studio 2026.9.4, installed from the
unsloth.deb (/usr/bin/unsloth-studio) - WebKitGTK:
libwebkit2gtk-4.1-02.50.4-0ubuntu0.22.04.1 - Desktop backend
unsloth studio --api-onlystarts normally, reportsHardware detected: CUDA -- NVIDIA GeForce RTX 3070 - Soft
RLIMIT_NOFILE1024 / hard 1048576 (stock systemd/Ubuntu defaults, nothing custom inlimits.conf)
What happened?
Steps to reproduce:
- Install the .deb and launch Unsloth from the application menu (or run
/usr/bin/unsloth-studio) on an X11 session with an NVIDIA GPU and the stock soft fd limit of 1024. - The window opens and the backend starts normally.
- Within 5-40 seconds the WebKit web content process dies and the window is left blank/frozen. No error dialog, no crash reporter — the main app process stays alive at ~6% CPU, so to a user this looks like the app "hanging", not crashing.
- If the fd limit is raised instead (e.g.
ulimit -n 65536), the window works for a while, but the renderer's fd count climbs to the new ceiling and then the UI wedges at it.
Expected behavior: the Studio window stays usable.
Actual behavior: the renderer exhausts the file descriptor limit and either aborts or wedges; the window is permanently blank/frozen while the process tree stays alive.
Model and operation involved: none specific — this happens on the Model hub / startup screen. It reproduced with nothing downloaded and no model loaded, and also during a GGUF hub download.
Diagnostics and logs
The renderer's last words, from ~/.unsloth/studio/tauri.log (captured three separate times; local time CEST):
(WebKitWebProcess:30270): GLib-ERROR **: 15:25:55.997: Creating pipes for GWakeup: Too many open files
(WebKitWebProcess:30687): GLib-ERROR **: 15:27:09.677: Creating pipes for GWakeup: Too many open files
(WebKitWebProcess:31306): GLib-ERROR **: 15:50:07.237: Creating pipes for GWakeup: Too many open files
coredumpctl list for the same session — every core is a WebKitWebProcess, SIGABRT or SIGTRAP:
15:17:11 SIGTRAP WebKitWebProcess
15:24:09 SIGABRT WebKitWebProcess
15:25:59 SIGTRAP WebKitWebProcess
15:27:13 SIGTRAP WebKitWebProcess
15:50:07 SIGABRT WebKitWebProcess
The cores are stored truncated (~1.7-33 MB), so no usable backtrace.
The resource that runs out: anon_inode:sync_file (DMA-BUF fences).
ls -l /proc/<WebKitWebProcess>/fd, on a run launched with ulimit -n 65536:
anon_inode:sync_file 12367 <- at ~2 minutes uptime
/dev/nvidia 27
/dev/nvidia-modeset 5
/dev/nvidiactl 4
/dev/dri/renderD* 2
Growth is monotonic and UI-activity-bound: roughly 130-200 new sync_file fds per second while the UI is busy, plateauing when it is idle. Timeline of that single run: 12,367 -> 32,408 -> 52,510 (4 min) -> 55,409 -> and when I let it run further it reached 65,534 of 65,536 and simply stopped responding, with no core dump (the UI froze at the ceiling rather than aborting).
At the same moments, dmesg shows the driver side of the same exhaustion — -24 is EMFILE:
drm:nv_drm_semsurf_fence_create_ioctl [nvidia_drm] *ERROR* [GPU ID 0x00000900] Failed to create sync file from fence on ctx 0x00000004
drm:nv_drm_semsurf_fence_wait_ioctl [nvidia_drm] *ERROR* [GPU ID 0x00000900] Attempt to wait on invalid sync FD: -24
These fds are never released. With soft 1024 the process dies within seconds of startup; with 65,536 it survives minutes and then wedges; the limit only controls how long it takes, so raising RLIMIT_NOFILE is not a fix.
A/B results on this machine
| Configuration | Result |
|---|---|
| Default (soft NOFILE 1024) | renderer dead in 5-40 s, every run (4/4), core dumped |
ulimit -n 65536 |
works, but sync_file fds climb to the ceiling, then UI wedges |
WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 WEBKIT_FORCE_DMABUF_RENDERER=1 (the pair the app's own log recommends "for WebKitGTK compatibility") |
does not help — renderer died the same way (15:25:59) |
WEBKIT_DISABLE_DMABUF_RENDERER=1 |
fixes it — renderer stable for the whole 2.5+ min observation on the stock 1024 limit, /proc/<pid>/fd flat at 30-34, sync_file count 0, UI renders fully and normally |
Sanity check that this is not WebKitGTK in general: a minimal GTK3 + WebKit2 4.1 WebView in this same session, rendering an animated WebGL canvas, held a flat 47-49 fds with 3 sync_file fds and never grew. The churn needs the Studio UI on the DMABUF renderer path.
Relations to existing issues
- Since this machine is a non-Wayland (X11) session, per the table in Studio on Linux: WEBKIT_DISABLE_DMABUF_RENDERER=1 is full software rendering on WebKitGTK 2.44+, and we set it for AppImage on Wayland #9393 (
studio/src-tauri/src/linux_webkit.rs, "Non-Wayland session, or an explicitly non-WaylandGDK_BACKEND-> nothing", lines 78-83) Studio sets no workaround variable at all, so the DMABUF renderer stays enabled. That row is exactly this configuration, and on NVIDIA/X11 it is not safe. - It also nuances Studio on Linux: WEBKIT_DISABLE_DMABUF_RENDERER=1 is full software rendering on WebKitGTK 2.44+, and we set it for AppImage on Wayland #9393's premise that
WEBKIT_DMABUF_RENDERER_FORCE_SHM=1is the lighter equivalent of the heavy switch: here the "lighter" pair did not avoid the failure, while the heavy switch did. The fd leak lives on the path thatWEBKIT_DISABLE_DMABUF_RENDERER=1removes. - [Studio Bug] Model Hub crashes WebKitWebProcess (SIGABRT) — Skia COLRv1 font assert, not #9393 #9480 was a different
WebKitWebProcesscrash (Skia COLRv1 font assert), not this one.
Additional context
The workaround I applied locally is a user-level desktop entry so the switch is always present:
Exec=env WEBKIT_DISABLE_DMABUF_RENDERER=1 /usr/bin/unsloth-studio %uSuggestions, in order of usefulness to me:
- Treat "X11/non-Wayland + NVIDIA" like the AppImage/Wayland rows and set
WEBKIT_DISABLE_DMABUF_RENDERER=1(a cheap probe would be the presence of/sys/module/nvidiawhile there is no Wayland session). I understand from Studio on Linux: WEBKIT_DISABLE_DMABUF_RENDERER=1 is full software rendering on WebKitGTK 2.44+, and we set it for AppImage on Wayland #9393 that this costs accelerated compositing; for NVIDIA/X11 users that is much better than a window that dies in 10 seconds. - Consider a startup check that warns when the soft
RLIMIT_NOFILEis low — but note it only delays this, since the fds are never returned, so it should not be presented as a solution. - The actual leak is upstream in the WebKitGTK DMABUF renderer / the
nv_drmfence export path (theinvalid sync FD: -24messages are the smoking gun); worth a WebKit Bugzilla entry with the fd timelines above if you agree with the diagnosis.
Happy to run any instrumented build, paste more of tauri.log//proc/<pid>/fd at specific moments, or test a patch — this machine reproduces it in well under a minute with the stock fd limit.
Activity
Desktop: stop the NVIDIA X11 flicker on WebKitGTK 2.54 (unslothai#16318…
Desktop: step wheel scrolling when WebKitGTK is not compositing (unsl…