## Debian 12 on a Thinkpad Yoga 14 ### NVIDIA driver compilation issues screw up Liquorix kernels If the installs go real bad, you'll get kernel panics when trying to boot with the system complaining about missing initramfs. * Boot to the highest kernel version maintenance mode that works * `dpkg --list | grep linux-image | grep -E '^i'` * For each kernel in the list: `update-initramfs -u -k ` * `update-grub` * Reboot ### Neovim/Wayland Clipboard * To get the clipboard to work, `apt install wl-clipboard`, as Debian 12 uses Wayland: https://ramezanpour.net/post/2022/07/24/access-os-clipboard-in-neovim * Copying from stdout to clipboard: `command | wl-copy` ### Laptop sleep Bookworm's Linux kernel 6.2 with Nvidia driver 525 did not agree with my laptop wrt sleep. I had to: * Install 6.4 via Liquorix: https://liquorix.net/ * Patch the Nvidia driver source in `/usr/src` with this: https://gist.github.com/joanbm/77f0650d45747b9a4dc8e330ade2bf5c * The diff is for an older Nvidia driver but it works just the same ```diff --- a/nvidia-drm/nvidia-drm-drv.c +++ b/nvidia-drm/nvidia-drm-drv.c @@ -20,6 +20,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */ #include "nvidia-drm-priv.h" @@ -873,7 +874,11 @@ static void nv_drm_update_drm_driver_features(void) nv_drm_driver.dumb_create = nv_drm_dumb_create; nv_drm_driver.dumb_map_offset = nv_drm_dumb_map_offset; +// Rel. commit "drm: remove dumb_destroy callback" (Christian König, 26 Jan 2023) +// NB: No resources are leaked, the kernel releases the same resources by default +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) nv_drm_driver.dumb_destroy = nv_drm_dumb_destroy; +#endif #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */ } -- 2.40.1 ``` ### Liquorix 6.5 and NVIDIA 525 The signature of the `get_user_pages` function changed in Linux kernel 6.5 and above. Apply this patch to get 525 working with Liquorix: https://gist.github.com/Fjodor42/cfd29b3ffd1d1957894469f2def8f4f6 ```bash cd /usr/src/nvidia-current-525.125.06 wget https://gist.github.com/Fjodor42/cfd29b3ffd1d1957894469f2def8f4f6 patch -i nvidia-535xx-fix-linux-6.5.patch -p 1 ``` ## AppImageLauncher on Debian The `.deb` didn't work so I'm building from scratch from the `master` branch: ``` sudo apt install checkinstall automake libtool wget libglib2.0-dev libcairo2-dev librsvg2-dev libfuse3-dev libfuse-dev libssl-dev qtbase5-dev qtdeclarative5-dev libqcoro5quick0 libxpm-dev qttools5-dev-tools patchelf ``` ## Debian 12 Bluetooth If Bluetooth stops working, some PulseAudio stuff likely made it in. Clean it out and start fresh: ```bash apt install pipewire-audio apt install libspa-0.2-bluetooth ``` ## Overloaded USB bus and write timeouts If you're getting a kernel panic doing heavy reads and writes to USB devices with the message `blocked for more than 120 seconds`, slow down the writes and get the system to flush the write cache more often. The issue is that the computer can't write cached writes to disk fast enough and the kernel freaks out. I got this while `rsync`ing one drive to another on a mini PC. ``` # /etc/sysctl.conf vm.dirty_background_ratio = 5 vm.dirty_ratio = 10 ``` And to be extra safe, slow down the data transfer: ```bash rsync -vra --progress --bwlimit=1500 /src /dest ``` ### Links * https://www.blackmoreops.com/2014/09/22/linux-kernel-panic-issue-fix-hung_task_timeout_secs-blocked-120-seconds-problem/ * https://stackoverflow.com/questions/27900221/difference-between-vm-dirty-ratio-and-vm-dirty-background-ratio * https://forums.debian.net/viewtopic.php?t=154544