https://www.jeffgeerling.com/blog/2024/amd-radeon-pro-w7700-running-on-raspberry-pi
Install all needed dependencies for kernel compilation:
sudo apt install git bc bison flex libssl-dev make libc6-dev libncurses5-dev crossbuild-essential-arm64 libelf-devThis installs the essential packages needed for kernel compilation on Raspberry Pi OS. You should now be able to run make menuconfig successfully.
Based on Jeff Geerling's guide, here are the steps you need to follow:
- First, edit the boot config to enable PCIe Gen 3:
sudo nano /boot/firmware/config.txtAdd this line at the bottom:
dtparam=pciex1_gen=3
- Install the required package for kernel compilation:
sudo apt install libncurses-dev- Clone and patch the kernel:
git clone --depth=1 https://github.com/raspberrypi/linux
cd linux
wget -O amdgpu-pi5.patch https://github.com/geerlingguy/linux/pull/8.patch
git apply -v amdgpu-pi5.patch- Configure the kernel with menuconfig to enable AMD GPU support:
make menuconfigYou'll need to navigate through the menus to select AMD GPU support.
- Compile the kernel (this will take a while):
make -j6 Image.gz modules dtbs- Apply Coreforge's memory optimization:
wget https://gist.githubusercontent.com/Coreforge/91da3d410ec7eb0ef5bc8dee24b91359/raw/b4848d1da9fff0cfcf7b601713efac1909e408e8/memcpy_unaligned.c
gcc -shared -fPIC -o memcpy.so memcpy_unaligned.c
sudo mv memcpy.so /usr/local/lib/memcpy.so
sudo nano /etc/ld.so.preloadAdd this line to ld.so.preload:
/usr/local/lib/memcpy.so
- Install AMD firmware:
sudo apt install firmware-amd-graphics- Reboot the Pi
Would you like me to explain any of these steps in more detail? For example, I can help walk you through the menuconfig navigation for enabling AMD GPU support.
checking 6.6.y
When you clone the kernel repository, you can specify exactly which branch you want. Let me explain how to ensure you're on the right version.
First, let's check what branch you're currently on:
cd linux git branchTo specifically get the 6.6.y branch that was used for the patch, you'll want to:
cd .. rm -rf linuxThe
--branch rpi-6.6.ypart is crucial here - it tells Git to specifically check out the 6.6.y branch that the patch was designed for. The--depth=1part means we only get the latest commit from that branch, making the download much faster.After this, when you apply the patch:
cd linux wget -O amdgpu-pi5.patch https://github.com/geerlingguy/linux/pull/8.patch git apply -v amdgpu-pi5.patchIt should work more reliably because you're starting from the same base version that the patch was created against. Would you like to try these steps to get a fresh start with the correct kernel version?