You are not logged in.

#1 2017-08-04 15:15:10

FreelancePolice
Member
Registered: 2017-06-25
Posts: 4

[SOLVED]NVIDIA and custom kernels

Apologies if this would be better suited to the Newbie Corner.

I'm using the proprietary NVIDIA drivers. Out of curiosity, I've tried to compile my own kernel, only to find that the NVIDIA driver didn't seem to work with it, even though every stock Arch kernel seems to work out-of-the-box with it. I know that the nvidia-dkms package exists, and it may help get it to work with a custom kernel, but I'm interested in knowing why NVIDIA automatically works with stock updates, and doesn't with custom ones -- and why simply reinstalling the nvidia package won't get it to work on a custom kernel.

I'm mostly just trying to learn more about how the kernel works; I'm sorry if this is a stupid question.

Last edited by FreelancePolice (2017-08-04 23:04:46)

Offline

#2 2017-08-04 15:21:27

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: [SOLVED]NVIDIA and custom kernels


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#3 2017-08-04 15:37:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,435

Re: [SOLVED]NVIDIA and custom kernels

Kernel modules have to be compiled against the headers of the kernel they are intended to be ran on. For the official packages this is done by the respective package maintainers each time this becomes necessary. For custom kernels you either do it manually and create a e.g. nvidia-custom package that you rebuild every time the kernel headers change. or employ DKMS which ultimately does the same thing, just with less necessary active participation on your side.

There's no magic behind why it works with the stock Arch kernel. The respective packages are simply being packaged in lockstep with the kernel they refer to (e.g. nvidia <-> linux, nvidia-lts <-> linux-lts)

Mod note, moving to NC

Offline

#4 2017-08-04 15:45:58

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED]NVIDIA and custom kernels

dockland, how does telling the OP about the existence of dkms answer a question that is specifically about "I know there is dkms, but I am interested in knowing why that matters".

FreelancePolice, the basic idea behind kernel modules is they have to be built specifically against the kernel you use. All kinds of things can change in the ABI from kernel version to kernel version, and even between different patched kernels... so the name and version of a custom kernel is usually automatically added to the directory name that out-of-tree modules like nvidia are stored in. Depending on what exactly you changed, it *might* be safe to load the version built against the repo kernel (although you'd need to do so via `insmod /path/to/wrong/version/of/module.ko.gz`), but it is infinitely safer to just rebuild it.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2017-08-04 15:54:03

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: [SOLVED]NVIDIA and custom kernels

My bad. I didn't read thoroughly enough. I see now, it's a matter of why, and not how.


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#6 2017-08-04 23:07:17

FreelancePolice
Member
Registered: 2017-06-25
Posts: 4

Re: [SOLVED]NVIDIA and custom kernels

V1del and Eschwartz, thank you for your answers. smile

Offline

Board footer

Powered by FluxBB