Skip to content

Instantly share code, notes, and snippets.

@geerlingguy
Last active April 14, 2024 16:26
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save geerlingguy/9f1510ab028e68b712381520308db2af to your computer and use it in GitHub Desktop.
Save geerlingguy/9f1510ab028e68b712381520308db2af to your computer and use it in GitHub Desktop.
Set up the Nvidia GeForce GT 710 on Raspberry Pi Compute Module 4
#!/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
@geerlingguy
Copy link
Author

@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

@mi-hol
Copy link

mi-hol commented Jul 19, 2021

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."

@mi-hol
Copy link

mi-hol commented Jul 19, 2021

@FUIT1985
Copy link

FUIT1985 commented Sep 6, 2021

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

@karan-ksrk
Copy link

any updates, with proper steps to make it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment