How to use NVidia with other kernels

When I install any new kernel, the NVidia GPU doesn't work: module nvidia is not available for current kernel. Is the corresponding package installed?

Typing optimus-manager in the console gives this

How do you get the GPU working with other kernels?

[7] INFO: # Xorg pre-start hook
[7] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'nvidia', 'current_mode': N
one}
[7] INFO: Requested mode is: nvidia
[34] INFO: Available modules: ['nouveau']
[34] INFO: Unloading modules ['nouveau'] (if loaded)
[37] INFO: switching=none, nothing to do
[49] INFO: Setting Nvidia PCI power state to on
[62] INFO: Writing "on" to /sys/bus/pci/devices/0000:01:00.2/power/control
[255] INFO: Writing "on" to /sys/bus/pci/devices/0000:01:00.0/power/control
[255] INFO: Writing "on" to /sys/bus/pci/devices/0000:01:00.3/power/control
[255] INFO: Writing "on" to /sys/bus/pci/devices/0000:01:00.1/power/control
[315] INFO: Loading module nvidia
[315] ERROR: Xorg pre-start setup error
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/optimus_manager/hooks/pre_xorg_start.py", line 51, in main
setup_kernel_state(config, prev_state, requested_mode)
File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 22, in setup_kernel_state
_nvidia_up(config, hybrid=(requested_mode == "hybrid"))
File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 95, in _nvidia_up
_load_nvidia_modules(config, available_modules)
File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 164, in _load_nvidia_modules
_load_module(available_modules, "nvidia", options=nvidia_options)
File "/usr/lib/python3.10/site-packages/optimus_manager/kernel.py", line 241, in _load_module
raise KernelSetupError(
optimus_manager.kernel.KernelSetupError: module nvidia is not available for current kernel. Is the corresponding package installed ?
[315] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
[315] INFO: Writing state {'type': 'pre_xorg_start_failed', 'switch_id': '20220930T204057', 'requested_mode':
'nvidia'}

My inxi

System:
Kernel: 5.15.71-1-lts arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-lts
root=UUID=58203bda-e2e2-4c32-a006-c91d933cad4e rw rootflags=subvol=@
loglevel=3 quiet intel_iommu=on iommu=pt ibt=off
Desktop: KDE Plasma v: 5.25.5 tk: Qt v: 5.15.6 info: latte-dock
wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Laptop System: Acer product: Predator PH315-53 v: V1.01
serial: <superuser required>
Mobo: CML model: QX50_CMS v: V1.01 serial: <superuser required>
UEFI: Insyde v: 1.01 date: 04/27/2020
Battery:
ID-1: BAT1 charge: 44.0 Wh (99.8%) condition: 44.1/58.8 Wh (75.1%)
volts: 16.4 min: 15.4 model: SMP AP18E7M type: Li-ion serial: <filter>
status: N/A
CPU:
Info: model: Intel Core i7-10750H bits: 64 type: MT MCP arch: Comet Lake
gen: core 10 level: v3 built: 2020 process: Intel 14nm family: 6
model-id: 0xA5 (165) stepping: 2 microcode: 0xF0
Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
L3: 12 MiB desc: 1x12 MiB
Speed (MHz): avg: 3183 high: 3586 min/max: 800/5000 scaling:
driver: intel_pstate governor: powersave cores: 1: 3586 2: 2961 3: 3444
4: 3498 5: 3499 6: 3500 7: 3500 8: 2754 9: 1948 10: 3388 11: 2753
12: 3373 bogomips: 62399
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities:
Type: itlb_multihit status: KVM: VMX disabled
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
Type: retbleed mitigation: Enhanced IBRS
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
prctl and seccomp
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
sanitization
Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB
filling, PBRSB-eIBRS: SW sequence
Type: srbds mitigation: Microcode
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: Intel CometLake-H GT2 [UHD Graphics] vendor: Acer Incorporated
ALI driver: i915 v: kernel arch: Gen-9.5 process: Intel 14nm
built: 2016-20 ports: active: eDP-1 empty: HDMI-A-1 bus-ID: 00:02.0
chip-ID: 8086:9bc4 class-ID: 0300
Device-2: NVIDIA TU106M [GeForce RTX 2060 Mobile] vendor: Acer
Incorporated ALI driver: N/A alternate: nouveau non-free: 515.xx+
status: current (as of 2022-08) arch: Turing code: TUxxx
process: TSMC 12nm built: 2018-22 pcie: gen: 3 speed: 8 GT/s lanes: 16
bus-ID: 01:00.0 chip-ID: 10de:1f15 class-ID: 0300
Device-3: Quanta HD User Facing type: USB driver: uvcvideo bus-ID: 1-5:3
chip-ID: 0408:a061 class-ID: 0e02
Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.3
compositor: kwin_x11 driver: X: loaded: intel unloaded: modesetting
alternate: fbdev,vesa gpu: i915 display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
s-diag: 582mm (22.93")
Monitor-1: eDP-1 mapped: eDP1 model: AU Optronics 0x82ed built: 2018
res: 1920x1080 hz: 144 dpi: 143 gamma: 1.2 size: 340x190mm (13.39x7.48")
diag: 394mm (15.5") ratio: 16:9 modes: 1920x1080
OpenGL: renderer: Mesa Intel UHD Graphics (CML GT2) v: 4.6 Mesa 22.1.7
direct render: Yes
Audio:
Device-1: Intel Comet Lake PCH cAVS vendor: Acer Incorporated ALI
driver: snd_hda_intel v: kernel bus-ID: 1-1.3:6
alternate: snd_soc_skl,snd_sof_pci_intel_cnl chip-ID: 08bb:29b0
bus-ID: 00:1f.3 class-ID: 0300 chip-ID: 8086:06c8 class-ID: 0403
Device-2: NVIDIA TU106 High Definition Audio vendor: Acer Incorporated
ALI driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
bus-ID: 01:00.1 chip-ID: 10de:10f9 class-ID: 0403
Device-3: Texas Instruments PCM2900B Audio CODEC type: USB
driver: hid-generic,snd-usb-audio,usbhid
Sound Server-1: ALSA v: k5.15.71-1-lts running: yes
Sound Server-2: sndio v: N/A running: no
Sound Server-3: PulseAudio v: 16.1 running: no
Sound Server-4: PipeWire v: 0.3.58 running: yes
Network:
Device-1: Intel Comet Lake PCH CNVi WiFi vendor: Rivet Networks
driver: iwlwifi v: kernel bus-ID: 00:14.3 chip-ID: 8086:06f0 class-ID: 0280
IF: wlp0s20f3 state: up mac: <filter>
Device-2: Realtek vendor: Acer Incorporated ALI driver: r8169 v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 07:00.0
chip-ID: 10ec:2600 class-ID: 0200
IF: enp7s0 state: down mac: <filter>
IF-ID-1: virbr0 state: down mac: <filter>
IF-ID-2: virbr1 state: down mac: <filter>
Bluetooth:
Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8
bus-ID: 1-14:5 chip-ID: 8087:0026 class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 2 state: down
bt-service: enabled,running rfk-block: hardware: no software: yes
address: <filter>
Drives:
Local Storage: total: 5.26 TiB used: 1.2 TiB (22.7%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital model: PC SN730
SDBQNTY-512G-1014 size: 476.94 GiB block-size: physical: 512 B
logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
rev: 11101100 temp: 24.9 C scheme: GPT
ID-2: /dev/sda maj-min: 8:0 vendor: HGST (Hitachi) model: HTS721010A9E630
size: 931.51 GiB block-size: physical: 4096 B logical: 512 B
speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter> rev: A3J0
scheme: GPT
ID-3: /dev/sdb maj-min: 8:16 vendor: Crucial model: CT275MX300SSD4
size: 256.17 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
type: SSD serial: <filter> rev: R060 scheme: GPT
ID-4: /dev/sdc maj-min: 8:32 type: USB vendor: Western Digital model: WD
Elements 2620 size: 3.64 TiB block-size: physical: 4096 B logical: 512 B
type: N/A serial: <filter> rev: 1023 scheme: GPT
Partition:
ID-1: / raw-size: 468.84 GiB size: 468.84 GiB (100.00%) used: 362.32 GiB
(77.3%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:3
ID-2: /boot/efi raw-size: 100 MiB size: 96 MiB (96.00%) used: 51.2 MiB
(53.4%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 468.84 GiB size: 468.84 GiB (100.00%) used: 362.32
GiB (77.3%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:3
ID-4: /var/log raw-size: 468.84 GiB size: 468.84 GiB (100.00%) used: 362.32
GiB (77.3%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:3
ID-5: /var/tmp raw-size: 468.84 GiB size: 468.84 GiB (100.00%) used: 362.32
GiB (77.3%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:3
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 15.46 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 67.0 C pch: 81.0 C mobo: N/A
Fan Speeds (RPM): N/A
Info:
Processes: 344 Uptime: 7m wakeups: 1 Memory: 15.46 GiB used: 3.11 GiB
(20.1%) Init: systemd v: 251 default: graphical tool: systemctl
Compilers: gcc: 12.2.0 alt: 11 clang: 14.0.6 Packages: pm: pacman
pkgs: 1971 libs: 517 tools: octopi,pamac,paru Shell: fish v: 3.5.1
default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.21
Garuda (2.6.8-1):
System install date:     2021-11-24
Last full system update: 2022-09-30
Is partially upgraded:   No
Relevant software:       NetworkManager
Windows dual boot:       Probably (Run as root to verify)
Snapshots:               Snapper
Failed units:            systemd-networkd-wait-online.service systemd-sysctl.service

Try

sudo pacman -S nvidia-lts

Then reboot.

sudo pacman -S nvidia-lts

resolving dependencies...
looking for conflicting packages...
:: nvidia-lts and nvidia-dkms are in conflict (NVIDIA-MODULE). Remove nvidia-dkms? [y/N] y
error: failed to prepare transaction (could not satisfy dependencies)
:: removing nvidia-dkms breaks dependency 'nvidia-dkms' required by garuda-nvidia-config

If I uninstall garuda-nvidia-config, that takes out Optimus Manager and the whole GPU configuration.

One solution is to use nvidia-all. That works.

Not sure if there's a better option.