-
-
Save geerlingguy/9f1510ab028e68b712381520308db2af to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# Attempt to set up the Nvidia GeForce GT 710 on a Pi CM4. | |
# | |
# I have tried both armv7l and aarch64 versions of the proprietary driver, in | |
# addition to the nouveau open source driver (which needs to be compiled into | |
# a custom Raspberry Pi kernel). | |
# | |
# tl;dr - None of the drivers worked :P | |
# First, expand the BAR space, following the directions in this gist: | |
# https://gist.github.com/geerlingguy/9d78ea34cab8e18d71ee5954417429df | |
##### | |
# Option A - Proprietary Driver | |
##### | |
# Install kernel-headers so kernel module can be built. | |
sudo apt-get update | |
sudo apt upgrade -y # if necessary | |
sudo reboot # if necessary | |
sudo apt install -y raspberrypi-kernel-headers | |
# Download driver from Nvidia's website. | |
# 32-bit: https://www.nvidia.com/en-us/drivers/unix/linux-arm-display-archive/ | |
# wget https://us.download.nvidia.com/XFree86/Linux-x86-ARM/390.138/NVIDIA-Linux-armv7l-gnueabihf-390.138.run | |
# 64-bit: https://www.nvidia.com/en-us/drivers/unix/linux-aarch64-archive/ | |
wget https://us.download.nvidia.com/XFree86/aarch64/455.28/NVIDIA-Linux-aarch64-455.28.run | |
# TODO: Any way to get the latest version and get the download URL in a script? Manual download is sooo annoying. | |
# (If running) stop X server. | |
sudo systemctl stop lightdm | |
# Run the driver .run file we just downloaded. | |
chmod +x ./NVIDIA-Linux-aarch64-455.28.run | |
sudo ./NVIDIA-Linux-aarch64-455.28.run | |
# For 32-bit: sudo ./NVIDIA-Linux-armv7l-gnueabihf-390.138.run --kernel-source-path /usr/src/linux-headers-5.4.51-v7l+ | |
# Reboot and (sadly) see the card fail to initialize. | |
sudo reboot | |
##### | |
# Option B - compile nouveau module into custom Pi Kernel | |
##### | |
# Install dependencies | |
sudo apt install -y git bc bison flex libssl-dev make | |
# Clone source | |
git clone --depth=1 https://github.com/raspberrypi/linux | |
# Apply default configuration | |
cd linux | |
export KERNEL=kernel7l # use kernel8 for 64-bit, or kernel7l for 32-bit | |
make bcm2711_defconfig | |
# Customize the .config further with menuconfig | |
sudo apt install -y libncurses5-dev | |
make menuconfig | |
# (search for /nouveau, enable in the proper section, save, then exit) | |
nano .config | |
# (edit CONFIG_LOCALVERSION and add a suffix that helps you identify your build) | |
# Build the kernel and copy everything into place | |
make -j4 zImage modules dtbs # 'Image' on 64-bit | |
sudo make modules_install | |
sudo cp arch/arm/boot/dts/*.dtb /boot/ | |
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/ | |
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/ | |
sudo cp arch/arm/boot/zImage /boot/$KERNEL.img | |
# Reboot, but it locks up if you have the card in :( | |
sudo reboot |
@pgwipeout - That's great debugging info — even though it's not explicitly Pi-related, do you think you could open an issue on the Pi PCI DB site I have and others could hopefully assist with the debugging? Sounds like similar issues: https://github.com/geerlingguy/raspberry-pi-pcie-devices/issues
Do today's Nvidia announcements (summary copied below) improve the situation at least for new graphics card?
"NVIDIA also used this first day of GDC week to release their 470.57.02 stable Linux driver as well as official DLSS SDK support for Linux.
The NVIDIA 470.57.02 Linux driver is out today as the first stable version in the NVIDIA 470 driver series. This carries forward the earlier beta changes around XWayland acceleration, new Vulkan extensions, and numerous other improvements."
"The RTXDI, NRD and RTXMU SDKs for Arm with Linux and Chromium are available now. RTXGI and DLSS will be coming soon. For more information, contact NVIDIA’s developer relations team or visit https://developer.nvidia.com."
Hi unfortunately I have never tested a raspberry, but I gladly follow your tests. I don't know if the below link can help you since raspberry doesn't support grub. Do you remember the old Macbook Pro with nvidia video card and the problems with linux? In order to use nvidia's proprietary driver it was necessary to disable the integrated video card of the intel processor through the xorg.conf file and grub. I hope that even if this advice doesn't help, it encourages you in your research.
https://askubuntu.com/questions/716565/macbook-pro-efi-and-nvidia-setpci-ids
any updates, with proper steps to make it work?
So I'm doing early bringup of a rk3566 development board on linux-next.
It has a PCIe controller with sufficient memory space to address the entire BAR region for a GTX645.
Nouveau probes the card successfully but locks up:
The 465 nvidia downstream driver won't build as is against Ubuntu 20.04 and linux-next.
After fixing the build issues, the module probes the card but once again locks up.
It also can't handle ACPI not existing, and eats itself in a hilarious way.
Enabling the modeset module leads to a soft lock, without it we get a null pointer error when X starts.
I don't have an IOMMU guarding the PCIe controller, but with vfio_pci in unsafe mode I attached it to QEMU running Tianocore with a qemu module loaded to execute option roms.
I got a partial (corrupt) display this way.
Loading linux from this stage in qemu leads to a panic in efi-stub due to the framebuffer being incorrect.
Dropping qemu and attempting to load nouveau it locks up at the same point as before.
Loading nvidia after dropping qemu leads to the same null pointer error.
Interestingly enough, if you let the nvidia driver load first, unload the nvidia driver, load vfio_pci, load qemu, the display is corrupt in a different way.
Without nvidia's interference, the display is dark grey with horizontal blue lines with red dots.
Text typed into the console was visible, but text displayed from the console is not.
With nvidia's interference, the display is bright white, with black boxes around the text typed into the console and text returned is white.