Skip to main content

Kernel setup

The ps5-linux project ships a patched kernel through ps5-linux-patches. Pre-built packages are available for Debian/Ubuntu (.deb) and Arch-based distros (.pkg.tar.zst).

The loader always starts the kernel (bzImage) and initrd (initrd.img) from the FAT32 partition of the USB drive, labelled boot and usually mounted at /boot/efi (or /efi on Bazzite). Whatever way you install a kernel, it has to end up there.

Install a pre-built kernel​

The easiest way is the package repository: it installs the kernel with your package manager, copies it to the boot partition for you, and keeps it up to date.

Or download a package from the ps5-linux-patches releases and install it:

sudo dpkg -i ps5-linux-*.deb
M.2 installs

Updating the kernel on an M.2 install can cause a black screen. Stay on 7.0.10 for now, see Known issues.

Build from source​

Build your own kernel to get fixes that aren't in a release yet, such as hardware video (VCN) and the Ethernet speed fix.

Dependencies​

GCC works, but Clang/LLVM is recommended.

# Clang (recommended)
sudo apt install clang llvm lld dwarves bison flex bc cpio python3 libssl-dev libelf-dev

# GCC
sudo apt install gcc dwarves bison flex bc cpio python3 libssl-dev libelf-dev

Build​

Clone ps5-linux-patches and linux side by side, then build:

git clone https://github.com/ps5-linux/ps5-linux-patches
git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
cd linux
git checkout "tags/v$(grep -m1 '^# Linux/' ../ps5-linux-patches/.config | awk '{print $3}')"
git apply ../ps5-linux-patches/linux.patch
cp ../ps5-linux-patches/.config .config
make olddefconfig

# With Clang (recommended)
make LLVM=1 LLVM_IAS=1 -j$(nproc)

# Or with GCC
make -j$(nproc)

sudo make modules_install
sudo make install
Use the latest kernel version

The git checkout line reads the kernel version from the patch set's .config, so it always matches the patches. If you check out a tag by hand instead, look up the current supported version on the ps5-linux-patches releases page first.

Copy the kernel to the boot partition​

Build the initrd for the new kernel, back up the current kernel on the boot partition, and copy the new one in place. Run this from the linux folder:

sudo update-initramfs -c -k "$(make -s kernelrelease)"
# Back up the current kernel and initrd
sudo mv /boot/efi/bzImage /boot/efi/bzImage.old
sudo mv /boot/efi/initrd.img /boot/efi/initrd.img.old

# Copy the new kernel and initrd
sudo cp arch/x86/boot/bzImage /boot/efi/bzImage
sudo cp /boot/initrd.img-$(make -s kernelrelease) /boot/efi/initrd.img
sync

If the new kernel doesn't boot, rename the .old files back from another computer (the boot partition is FAT32, so any PC can open it).

Building a kernel for Bazzite Game Mode​

Bazzite's Game Mode starts Steam through the cardwired service, which loads an eBPF program. That needs two kernel features the PS5 kernel configs don't enable:

  1. The BPF LSM. CONFIG_BPF_LSM=y is set, but bpf is missing from CONFIG_LSM, so it never activates. Add bpf to CONFIG_LSM, or add lsm=landlock,lockdown,yama,integrity,apparmor,bpf to cmdline.txt.
  2. Kernel BTF. Turn on CONFIG_DEBUG_INFO_BTF so that /sys/kernel/btf/vmlinux exists.

Without them, cardwired crash-loops with CardwireEbpfError(LSMNotEnabled) or error parsing /sys/kernel/btf/vmlinux, Gamescope is killed a second after it starts, and after five attempts Bazzite drops you to the desktop. PS5 Bazzite Deck applies both changes.

Pending in ps5-linux-patches​

  • amdgpu SMU driver: correct GPU frequency and temperature reporting
  • HDMI converter: improvements for HDR, RGB range and 120 Hz

Kernel parameters (cmdline.txt)​

The kernel command line is stored in cmdline.txt on the FAT32 partition of your USB drive. Edit it to pass your own parameters. From Windows, see Edit cmdline.txt from Windows.

The default command line looks like this (it varies slightly between images):

cmdline.txt
root=LABEL=__DISTRO__ rw rootwait console=ttyTitania0 console=tty0 mitigations=off idle=halt preempt=full
  • console=ttyTitania0: Sony's internal name for the UART serial console. Useful when debugging headless over UART.
  • mitigations=off: Spectre/Meltdown mitigations are off by default for performance. Change it to mitigations=auto if you want them back.
  • idle=halt: try removing it if you notice micro-stuttering, see GPU performance tips.

Common display-related parameters:

# Force 1080p if the display isn't detected correctly
amdgpu.force_1080p=1

# Remove this if you get a black screen
video=DP-1:1920x1080@60

Other useful parameters:

ParameterWhat it doesMore info
amdgpu.ps5_cu_unlock=3Unlocks all disabled GPU compute units40 CU unlock
ttm.pages_limit=...Raises the GPU memory (GTT) ceilingVRAM
video=HDMI-A-1:3840x2160@60Forces a 4K mode4K black screen
drm.edid_firmware=...Loads a custom EDID fileCustom EDID
usb-storage.quirks=xxxx:yyyy:uTurns off UAS for one USB driveUSB drive
usbc_dp.enable=1DisplayPort output on the front USB-C port (PS5 Bazzite Deck)Boot options
hdmi.frl_4k120=0Never offers 4K at 120 Hz (PS5 Bazzite Deck)Boot options

cmdline.txt must stay a single line. Add options at the end, separated by a space.

VRAM (vram.txt)​

The default VRAM allocation is 512 MB and dynamic. To change it, edit vram.txt on the FAT32 partition. The value is a hexadecimal byte count, not decimal megabytes. See VRAM for the correct format and a table of sizes, and the AMD BC-250 docs for background.