I started one topic about Nvidia but it seems that I should learn how to read Arch Wiki.
I’ll try not to do too long topic but I would like to start with:
Custom kernel
If you are using a custom kernel, compilation of the Nvidia kernel modules can be automated with DKMS.
Install the nvidia-dkms package (or a specific branch). The Nvidia module will be rebuilt after every Nvidia or kernel update thanks to the DKMS pacman hook.
DRM kernel mode setting
nvidia 364.16 adds support for DRM (Direct Rendering Manager) kernel mode setting. To enable this feature, add the nvidia-drm.modeset=1kernel parameter. For basic functionality that should suffice, if you want to ensure it’s loaded at the earliest possible occasion, or are noticing startup issues you can add nvidia , nvidia_modeset , nvidia_uvm and nvidia_drm to the initramfs according to Mkinitcpio#MODULES.
If added to the initramfs do not forget to run mkinitcpio every time there is a nvidia driver update. See #Pacman hook to automate these steps.
Custom kernel and DRM kernel mode settings are not connected right?
I can do one or another or both. I don’t need to do DRM kernel mode setting if I install Custom kernel?
To enable DRM with nvidia-drm.modeset=1
I need to edit /etc/default/grub
And change cmdline to tool like this: GRUB_CMDLINE_LINUX_DEFAULT="nvidia-drm.modeset=1"
add
I can finish at this point but I can I can but not have to?
add nvidia , nvidia_modeset , nvidia_uvm and nvidia_drm modules to my mkinitcpio.conf file and it should look like this:
MODULES=( nvidia nvidia_modeset nvidia_uvm nvidia_drm)
I don’t understand if it is:
only 2 or only 3
it can be just 2 or just 3
if I want 3 I have to do 2 first
If I add modeulse like in point 3 then I’ll have to run mkinitcpio -P with every Nvidia update manually or
In /etc/pacman.d/hooks/ I can create nvidia.hook with:
[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
Target=linux
[Action]
Description=Update Nvidia module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c ‘while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P’
And change linux for linux-zen or any other kernel I have
I believe that I get it quite right but I’m not sure about points 3 and 4
Your mkinitcpio.conf contains the following, near the top…
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES=(piix ide_disk reiserfs)
MODULES=()
So, put the list of modules in between the two elipses on that last line, separated by a space.
To enable DRM with nvidia-drm.modeset=1
I need to edit /etc/default/grub
And change cmdline to tool like this:
GRUB_CMDLINE_LINUX_DEFAULT=“nvidia-drm.modeset=1”
And wiki says:
For basic functionality that should suffice, if you want to ensure it’s loaded at the earliest possible occasion, or are noticing startup issues you can add nvidia , nvidia_modeset , nvidia_uvm and nvidia_drm to the initramfs according to Mkinitcpio#MODULES.
Is that men that I should have enabled (in grub config) nvidia-drm.modeset=1 and add modules to mkinitcpio.conf
or I should delete nvidia-drm.modeset=1 from grub and add those modules?
I checked with: mkinitcpio -v
At the end of an output there is:
==> ERROR: module not found: nvidia' ==> ERROR: module not found: nvidia_modeset’
adding module: nvidia-uvm (/lib/modules/5.9.6-arch1-1/kernel/drivers/video/nvidia-uvm.ko.xz)
==> ERROR: module not found: nvidia' ==> ERROR: module not found: nvidia_drm’
I have nvidia-dkms currently installed. I did as mentioned above
Modules(nvidia …)
Change the linux part above and in the Exec line if a different kernel is used
[Action]
Description=Update Nvidia module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c 'while read -r trg; do case $trg in linux) exit 0; esac; done; /usr/bin/mkinitcpio -P'
adding a line with Target=linux-zen is quite understandable.
But it should be changed in Exec to.
If I would have to guess Exec=/bin/sh -c 'while read -r trg; do case $trg in linux or linux-zen) exit 0; esac; done; /usr/bin/mkinitcpio -P'
[quote=“Aragorn, post:12, topic:36630, full:true”]
You have to specify the path to the files. See the Wiki page.
[/quote]>
BINARIES and FILES
These options allow users to add files to the image. Both BINARIES and FILES are added before hooks are run, and may be used to override files used or provided by a hook. BINARIES are auto-located within a standard PATH and are dependency-parsed, meaning any required libraries will also be added. FILES are added as-is . For example:
FILES=(/etc/modprobe.d/modprobe.conf)
This page?
And I should know where those files are?
I tried with locate but have no idea which files should I use
Note: The complication in the Exec line above is in order to avoid running mkinitcpio multiple times if both nvidia and linux get updated. In case this doesn’t bother you, the Target=linux and NeedsTargets lines may be dropped, and the Exec line may be reduced to simply Exec=/usr/bin/mkinitcpio -P .
I read this just a second ago. My fault.
So I can just create file: