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-dev
This 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.txt
Add 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 menuconfig
You'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.preload
Add 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 branch
To specifically get the 6.6.y branch that was used for the patch, you'll want to:
cd .. rm -rf linux
The
--branch rpi-6.6.y
part is crucial here - it tells Git to specifically check out the 6.6.y branch that the patch was designed for. The--depth=1
part 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.patch
It 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?