Installing NVIDIA on linux custom kernel

Hi there.

I have a GeForce GTX 1650 Ti Mobile in my HP Spectre x360, running Fedora 35.

I patched and compiled kernel 5.15.6 to fix a problem with my laptop’s speakers. The fix was successful, but now the NVIDIA modules won’t install.

At startup I get the error:

NVIDIA kernel module missing. Falling back to nouveau.

kernel-headers was successfully generated and I installed it, but the NVIDIA installer fails at DKMS:

[code]ERROR: Failed to run ‘/usr/sbin/dkms build -m nvidia -v 470.94 -k 5.15.16’: Error! Your kernel headers for kernel 5.15.16 cannnot be found at /lib/modules/5.15.16/build or /lib/modules/5.15.16/source.

Please install the linux-headers-5.15.16 package or use the --kernelsourcedir option to tell DMKS where it’s located.[/code]

I copied the source from the unpacked tar to /lib/modules/5.15.16/source, but the error remains.

When using the kernel from Fedora (or any other distro) the modules install fine, but not with the one I compiled.

I’m not very experienced with kernel compiling, so any help would be much appreciated.

Below is the process I used to compile the kernel.

Fedora 35, HP Spectre x360 15-eb0016TX.

[code]curl|tar -xJ

cd linux-5.15.16
vim ~/linux-5.15.16/sound/pci/hda/patch_realtek.c[/code]

Added the following line

SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx",

Make menuconfig make -j7 make binrpm-pkg

Just copy/move ~/linux-5.15.16 to /usr/src/linux-5.15.16
then create the symlink for dkms
ln -s /usr/src/linux-5.15.16 /lib/modules/5.15.16/build
then trigger dkms again.

Thanks very much.

I got it to install.

Now I’m getting a blank screen on GDM. The official drivers seem to install fine. There aren’t any errors in journalctl and even turning on debugging in GDM doesn’t give any errors.

Installing it from rpmfusion using akmods gives error:

 Nvidia kernel module missing, Falling back to nouveau.

Installing via akmods --force gives the following error:

2022/01/28 07:02:19 akmodsbuild: error: Package has no %description: kmod-nvidia-5.15.16-Fedora.Spectre.5.15.1

No idea if these problems are related. The kernel package does have a description in the spec.

About packages:

Rebuilding with rpm-pkg produced -headers and -devel packages, so I didn’t have to link the source again.

Please run as root and attach the resulting nvidia-bug-report.log.gz file to your post.

See 2012209 – Nvidia Akmod Fails to build against custom kernel