Display doesnt work with custom kernel

I need to use a custom kernel on my carrier board due to a few missing features in the stock kernel.
The issue is device tree independent and I can boot my custom DT with the stock kernel and the displays works.
When booting the custom kernel, the display never comes up and I’ve tracked this down to the display drivers in <kernel_mods>/extra missing. I saw another thread on this and the obvious attempt to copy these drivers to the new kernel didnt work since the module.symvers dont match.
I tried compiling the driver from the nvidia_display_driver_source package in the sources bundle but the makefiles are complicated and dont seem to be set up in a way to allow cross compiling. Compiling on device isnt practical since I would need to copy the build sources over and eventually this needs to be automated to build on a single host.

I have two questions:

  1. Why doesnt nvidia just include this as part of the kernel build process?
  2. is there a way to cross compile this? My kernel build setup also uses the O=builddir build method so the sources and config are never together.

There should be a readme file inside the tarball. Have you tried that?

Also, have you tried to directly add the pre-build drivers from default BSP and see if it works? I notice there may be something else causing the error but not the post you pasted.

BTW, share us the log instead of only telling symptoms.

The default BSP drivers do not work due to the symbol mismatch. They have to be compiled against the custom kernel.
There is no readme in this version of the driver sources. I found one in the EA version of the driver that I happen to have and was able to make it compile.

I wrote a little helper script to make it easy. Hopefully others will find this useful.

#!/bin/bash
# Build tool for nvidia display driver to cross-compile on an x86 host
# finished modules will be in $DRIVER_SOURCE_DIR/kernel-open

# OPTIONAL: set if using external toolchain (linaro, etc). Must match toolchain used to compile kernel
#TOOLCHAIN_PATH="$(pwd)/toolchain/bin"
# Cross-compiler prefix
CROSS_PREFIX="aarch64-linux-gnu-"
# Path to display driver sources
DRIVER_SOURCE_DIR="display_driver/NVIDIA-kernel-module-source-TempVersion"
# Full path to kernel build dir.
KERNEL_BUILD_OUTPUT="$(pwd)/build"
# Full path to kernel sources dir
KERNEL_SOURCES_DIR="$(pwd)/merged/kernel/kernel-5.10"


# sets up toolchain path if building with other toolchain.
if [ -n "$TOOLCHAIN_PATH" ]; then
     export PATH="${PATH}:${TOOLCHAIN_PATH}"
fi

make -C "$DRIVER_SOURCE_DIR" modules -j $(nproc) TARGET_ARCH=aarch64 ARCH=arm64 CC="${CROSS_PREFIX}gcc" \
LD="${CROSS_PREFIX}ld" AR="${CROSS_PREFIX}ar" CXX="${CROSS_PREFIX}g++" OBJCOPY="${CROSS_PREFIX}objcopy" \
SYSOUT="$KERNEL_BUILD_OUTPUT" SYSSRC="$KERNEL_SOURCES_DIR"

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.