Drawing Tablet loses functionality/program freeze (?)

Hi, I’ve been using Endeavour OS for only a few days now and have been very happy with it. However I have run into a few issues trying to use my XP-Pen Artist Pro 16 (Gen 2), which I’d been fairly successful with resolving until now.

Whenever I try using Krita and use the undo keybind on my stylus a few times in succession or resize a pasted image, or after a few seconds of just using the stylus on an empty desktop even, the pen loses functionality and drivers cease to recognise the tablet as a drawing tablet. It continues to display and is recognised as a standard monitor however.

When this happens, other programs already open (and maximised) also seem to freeze or “break”- I can’t interact with buttons on Krita or change browser tabs on Firefox.

I’ve installed multiple versions of XP-Pen drivers, installed Open Tablet Driver, tried seeing if downloading different NVIDIA drivers helps, doing the steps for Optimus laptops, and a few other things that I’ve already forgotten. I have Zero idea what the root cause of this may be which is why I’ve hopped on here, but I did notice that GPU usage spikes and then almost immediately shoots to somewhere in the 1-15% range when it gives out.

Here’s a video of the issue: https://youtu.be/6ZD4eGjxJv0

Here’s my system log:

System:
  Kernel: 6.12.60-1-lts arch: x86_64 bits: 64 compiler: gcc v: 15.2.1
  Desktop: KDE Plasma v: 6.5.3 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
    Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: ASUS TUF Gaming A15
    FA506IHRB_FA506IHRB v: 1.0 serial: <superuser required>
  Mobo: ASUSTeK model: FA506IHRB v: 1.0 serial: <superuser required>
    Firmware: UEFI vendor: American Megatrends v: FA506IHRB.307 date: 12/28/2022
Battery:
  ID-1: BAT1 charge: 31.2 Wh (100%) condition: 31.2/48 Wh (64.9%) volts: 12.09
    min: 11.68 model: ASUS A32-K55 serial: N/A charging: status: full
    cycles: N/A
CPU:
  Info: 6-core model: AMD Ryzen 5 4600H with Radeon Graphics bits: 64
    type: MT MCP arch: Zen 2 rev: 1 cache: L1: 384 KiB L2: 3 MiB L3: 8 MiB
  Speed (MHz): avg: 1113 min/max: 400/4006 boost: enabled cores: 1: 1113
    2: 1113 3: 1113 4: 1113 5: 1113 6: 1113 7: 1113 8: 1113 9: 1113 10: 1113
    11: 1113 12: 1113 bogomips: 71898
  Flags-basic: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a
    ssse3 svm
Graphics:
  Device-1: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: ASUSTeK
    driver: nvidia v: 580.105.08 arch: Turing pcie: speed: 2.5 GT/s lanes: 8
    ports: active: DP-1 empty: none bus-ID: 01:00.0 chip-ID: 10de:1f9d
  Device-2: Advanced Micro Devices [AMD/ATI] Renoir [Radeon Vega Series /
    Radeon Mobile Series] vendor: ASUSTeK driver: amdgpu v: kernel arch: GCN-5
    pcie: speed: 8 GT/s lanes: 16 ports: active: eDP-1 empty: HDMI-A-1
    bus-ID: 06:00.0 chip-ID: 1002:1636 temp: 53.0 C
  Device-3: Sonix USB2.0 HD UVC WebCam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-4:2 chip-ID: 322e:202c
  Display: wayland server: X.org v: 1.21.1.21 with: Xwayland v: 24.1.9
    compositor: kwin_wayland driver: X: loaded: amdgpu,nvidia dri: radeonsi
    gpu: amdgpu,nv_platform,nvidia,nvidia-nvswitch d-rect: 4480x1600
    display-ID: 0
  Monitor-1: DP-1 pos: right model: MD160QH res: 2560x1600 hz: 60 dpi: 188
    diag: 407mm (16")
  Monitor-2: eDP-1 pos: primary,left model: Najing CEC Panda 0x004d
    res: 1920x1080 hz: 144 dpi: 142 diag: 395mm (15.5")
  API: EGL v: 1.5 platforms: device: 0 drv: nvidia device: 1 drv: radeonsi
    device: 3 drv: swrast gbm: drv: kms_swrast surfaceless: drv: nvidia wayland:
    drv: radeonsi x11: drv: radeonsi inactive: device-2
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: amd mesa v: 25.3.1-arch1.2
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (radeonsi
    renoir ACO DRM 3.61 6.12.60-1-lts) device-ID: 1002:1636 display-ID: :1.0
  API: Vulkan v: 1.4.328 surfaces: N/A device: 0 type: discrete-gpu
    driver: nvidia device-ID: 10de:1f9d
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
    de: kscreen-console,kscreen-doctor gpu: nvidia-smi wl: wayland-info
    x11: xdpyinfo, xprop, xrandr
Audio:
  Device-1: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie:
    speed: 8 GT/s lanes: 8 bus-ID: 01:00.1 chip-ID: 10de:10fa
  Device-2: Advanced Micro Devices [AMD/ATI] Renoir/Cezanne HDMI/DP Audio
    vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s
    lanes: 16 bus-ID: 06:00.1 chip-ID: 1002:1637
  Device-3: Advanced Micro Devices [AMD] Audio Coprocessor driver: N/A pcie:
    speed: 8 GT/s lanes: 16 bus-ID: 06:00.5 chip-ID: 1022:15e2
  Device-4: Advanced Micro Devices [AMD] Family 17h/19h/1ah HD Audio
    vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s
    lanes: 16 bus-ID: 06:00.6 chip-ID: 1022:15e3
  API: ALSA v: k6.12.60-1-lts status: kernel-api
  Server-1: PipeWire v: 1.4.9 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: e000 bus-ID: 02:00.0 chip-ID: 10ec:8168
  IF: enp2s0 state: down mac: <filter>
  Device-2: Intel Wi-Fi 6E AX210/AX1675 2x2 [Typhoon Peak] driver: iwlwifi
    v: kernel pcie: speed: 5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:2725
  IF: wlan0 state: up mac: <filter>
Bluetooth:
  Device-1: Intel AX210 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 bus-ID: 3-3:3 chip-ID: 8087:0032
  Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: disabled
    rfk-block: hardware: no software: no address: N/A
Drives:
  Local Storage: total: 2.29 TiB used: 233.6 GiB (10.0%)
  ID-1: /dev/nvme0n1 vendor: Crucial model: CT2000P3PSSD8 size: 1.82 TiB
    speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 42.9 C
  ID-2: /dev/nvme1n1 vendor: Samsung model: MZVLQ512HBLU-00B00
    size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 29.9 C
Partition:
  ID-1: / size: 466.41 GiB used: 113.78 GiB (24.4%) fs: ext4
    dev: /dev/nvme1n1p2
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 62.4 C mobo: N/A gpu: amdgpu temp: 54.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 32 GiB note: est. available: 30.77 GiB used: 4.73 GiB (15.4%)
  Processes: 348 Power: uptime: 27m wakeups: 0 Init: systemd v: 258
    default: graphical
  Packages: pm: pacman pkgs: 1230 Compilers: gcc: 15.2.1 Shell: Bash
    v: 5.3.8 running-in: konsole inxi: 3.3.40

If there’s more I should share to help let me know but if it’s related to the console maybe show me how to do it or where to find the docs, I’m not particularly fluent in EOS yet lol

SO I realised a little late that there are actual system logs I should look at and here’s what shows up when it fails:

Dec 09 01:34:09 Dragon-Fire kwin_wayland[929]: 0x500: GL_INVALID_ENUM error generated. Invalid <face>.
Dec 09 01:34:09 Dragon-Fire kwin_wayland[929]: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"
Dec 09 01:34:09 Dragon-Fire kwin_wayland[929]: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
Dec 09 01:34:09 Dragon-Fire kwin_wayland[929]: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Dec 09 01:34:09 Dragon-Fire kwin_wayland[929]: Failed to create framebuffer: Invalid argument
Dec 09 01:34:09 Dragon-Fire kwin_wayland[929]: Failed to create framebuffer: Invalid argument
Dec 09 01:34:11 Dragon-Fire systemd[872]: app-org.kde.plasma\x2dsystemmonitor@79998cf3047c445793423e585d242e33.service: Consumed 14.107s CPU time, 129.8M memory peak.
Dec 09 01:34:12 Dragon-Fire systemd[872]: plasma-ksystemstats.service: Consumed 4.421s CPU time, 23M memory peak.
Dec 09 01:34:25 Dragon-Fire kwin_wayland[929]: 0x500: GL_INVALID_ENUM error generated. Invalid <face>.
Dec 09 01:34:25 Dragon-Fire kwin_wayland[929]: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"
Dec 09 01:34:25 Dragon-Fire kwin_wayland[929]: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
Dec 09 01:34:25 Dragon-Fire kwin_wayland[929]: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Dec 09 01:34:25 Dragon-Fire kwin_wayland[929]: Failed to create framebuffer: Invalid argument
Dec 09 01:34:25 Dragon-Fire kwin_wayland[929]: Failed to create framebuffer: Invalid argument
Dec 09 01:34:28 Dragon-Fire kwin_wayland[929]: 0x500: GL_INVALID_ENUM error generated. Invalid <face>.
Dec 09 01:34:28 Dragon-Fire kwin_wayland[929]: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"
Dec 09 01:34:28 Dragon-Fire kwin_wayland[929]: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
Dec 09 01:34:28 Dragon-Fire kwin_wayland[929]: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Dec 09 01:34:28 Dragon-Fire kwin_wayland[929]: Failed to create framebuffer: Invalid argument
Dec 09 01:34:28 Dragon-Fire kwin_wayland[929]: Failed to create framebuffer: Invalid argument

I’ll attempt working this out on my own from here but in case someone has any input to help I’m sharing anyway (or in case a newbie has similar issues)

Seems to possibly be related to these two bugs:

The system monitor crash bug has been marked as resolved though so I’m not entirely sure if this is related or not; I’ve tried the few workarounds I’ve seen for the GL bug however they do not work either.

Did you see if it happens outside of KDE?

Like if you just run it on i3 or openbox or sway or some other light window manager/compositor of your choosing? (don’t install a big complete desktop environment like say gnome or xfce as it can interfere with your kde configuration)

I have not, and to be fair that’d be expecting a lot from a newbie like me :laughing: I’m really liking KDE but I’ll definitely look into it

With the wayland ones like sway you just install it, press ctrl+alt+f2 to change to tty2 (doesn’t have to be tty2, can be 3 or 4 or whatever), log in and open it, in sway’s case by running sway.

For the xorg based ones you need xorg-xinitwhich allows you to do the same thing by running startx on the tty which will open X according to your ~/.xinitrc configuration.

Not shure if you have tried the “xp-pen-tablet” driver since you only mentioned open tablet driver. If you haven’t I would try it, since it is what I use with my tablet (pretty much same model as yours, just smaller)

Attempted installing this several times with different methods but did not launch :confused: sadly I believe my issue isn’t tablet driver related anyway

I’m surely doing something wrong but I’ve attempted installing several different WMs several times- Sway booted but did not resolve the issue, i3 had problems which prevented me from testing whether it was a solution, and others just straight up did not boot and I had to Timeshift restore :frowning:

After thinking on it in the downtime I’m fairly convinced my WM is not the issue, as it happens just using the stylus on the desktop itself, and the connection I noticed before between the tablet failing and GPU usage dropping dramatically.

Something I didn’t realise/mention in my original post is having any window open on the tablet monitor before it fails causes a high GPU usage. When it fails it also disconnects any USB device slotted in my first USB A slot and can sometimes disconnect external storage devices despite the slot that they’re in.

Wait I think maybe we’ve been looking at it all wrong. I watched the video of your issue, it seems the problem is that krita freezes temporarily. This is probably a bug in krita.

I have a couple of ideas.

  1. You are probably running krita with your AMD gpu, not your nvidia GPU, you should verify which GPU you are currently using for krita (use glxinfo | grep “renderer string” to check what you’re currently using for opengl, if i’m right you should probably be able to use prime-run to run on nvidia instead of amd.) basically just try running krita with the gpu you haven’t been using for it until now. Perhaps a simpler way to check is to run krita then run nvidia-smi which will show you what apps are running on the nvidia gpu.
  2. The bug could be something to do with instant preview, you can try disabling it.
  3. You could try setting the renderer in krita manually to opengl or opengl es in it’s settings.

I’ll try these anyway just to see if it works since I agree it’s likely related to my integrated GPU (I’m still looking at what would be best for me to force one GPU after remembering how AMD would occasionally crash at random when I used Windows) but I think I haven’t specified enough:

Krita does not freeze temporarily, it dies as soon as this issue starts and does not recover; I always have to force close Krita because I cannot use any buttons, even those on the “Do you want to save?” prompt when closing the program normally. This issue also isn’t confined just to Krita, as I can reproduce it on an empty desktop and Dolphin (eg. doing box selection without selecting anything) with only Firefox open.

The kwin error you claimed came up when this issue occurs is an opengl related one, so it’s a safe bet it’s graphical in nature.

I apologise if I came across too harshly I’ve been working on this for too long :pensive_face: I’d like to thank you for the nvidia-smicommand, it shed light on the fact my nvidia card is running my DEs and nothing else, lol.

…was already set to Nvidia GPU only. Intergrated hates the monitor display entirely and hybrid makes the issue occur even faster. I might just stop here for a bit so I don’t bang my head against a wall

Yes, by default the nvidia gpu will run all vulkan applications, but the opengl applications will run on the igpu, It’s actually a decent setup since it means the dgpu will primarily be reserved for games.

You should be able to use prime-run to run other things (like krita) on your dgpu.

Can definitely appreciate it using the dedicated for more complex processes at default

Unfortunately running Krita through Nvidia or your other suggestions doesn’t solve the disconnect issue :frowning: Krita is running happily on its own to my combined joy and dismay. I feel I’ve run into a dead end investigating through a GPU driver lens though so I’ve read a bit into the USB dropping out and found some posts about AMD drivers having issues with high loads + a kernel bug, which I’m hoping will lead to more answers and maybe even an end to my decent into madness, lol

Have you tried updating your bios? it’s a bit of a long shot but it might do the trick.

I don’t believe I have, but I’ll add it to my list

BIOS is on its newest version, and unfortunately my other solutions were related to BIOS options that are no longer available.

Welp, I have possibly never felt dumber until this moment.

The only difference this setup had compared to my Windows one was that it was plugged into a dedicated charger, (I did not have a desk or accessible power board until just before I switched to Linux, and I had held back on drawing in preparation of doing so) so I went and routed the USB A end into a spare slot. I hadn’t considered doing this until now because the cable is so thin I didn’t think it would be able to transfer information. (As I write this, I realise it may actually be taking the power load and letting the USB C cable transfer info, if I were to actually use my brain)

So far it is not failing when I attempt the stress tests that had been consistently making it fail so far- this is compounded by the fact that when I unplugged the charger cable from the laptop it almost instantly failed. Either my cable is going out, or something OS or hardware related can’t handle simultaneous high output and input. I don’t know enough to determine which just yet and to be honest, I’m just glad this is over even if my pride is very much hurt :smiling_face_with_tear: