Nvidia drivers not working after custom kernel installation

I recently had a problem with the audio from the headphone jack in my laptop which is a Asus GL503GE, I found a solution to this problem in this forum, what I did was patch the kernel with the realtek patch given there, I downloaded kernel version 5.4.70 LTS from kernel org, applied the patch, and compiled the kernel with the default config at /proc/config.gz. After adding the kernel to the /boot folder and adding the menu entry in grub I booted up my system with the new patched kernel which indeed solved the 3.5mm jack audio issue, but my nvidia drivers stopped working, I tried reinstalling them from Hardware Configuration but had no luck, the driver I am using right now is video-hybrid-intel-nvidia-450xx-prime.
The output from sudo nvidia-settings is:

ERROR: NVIDIA driver is not loaded 

ERROR: Unable to load info from any available system

The output for nvidia-smi is:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

My system info from inxi -Fazy is:

System:
  Kernel: 5.4.70-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-linux54fix 
  root=UUID=fbee015a-d962-458e-b4a8-2d14c7f7ba10 rw quiet apparmor=1 
  security=apparmor resume=UUID=aa732568-b8e2-453d-9712-8f36f62869ce 
  udev.log_priority=3 
  Desktop: KDE Plasma 5.19.5 tk: Qt 5.15.1 info: latte-dock wm: kwin_x11 
  dm: SDDM Distro: Manjaro Linux 
Machine:
  Type: Laptop System: ASUSTeK product: Strix 15 GL503GE v: 1.0 
  serial: <filter> 
  Mobo: ASUSTeK model: GL503GE v: 1.0 serial: <filter> 
  UEFI: American Megatrends v: GL503GE.316 date: 07/19/2019 
Battery:
  ID-1: BAT1 charge: 5.4 Wh condition: 50.3/64.4 Wh (78%) volts: 4.8/15.2 
  model: ASUS A32-K55 type: Li-ion serial: N/A status: Charging 
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M275/M280 
  serial: <filter> charge: 55% (should be ignored) rechargeable: yes 
  status: Discharging 
CPU:
  Topology: 6-Core model: Intel Core i7-8750H bits: 64 type: MT MCP 
  arch: Kaby Lake family: 6 model-id: 9E (158) stepping: A (10) microcode: D6 
  L2 cache: 9216 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 52815 
  Speed: 800 MHz min/max: 800/4100 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 
  4: 800 5: 800 6: 800 7: 800 8: 800 9: 800 10: 800 11: 800 12: 800 
  Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  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: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds mitigation: Microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel UHD Graphics 630 vendor: ASUSTeK driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:3e9b 
  Device-2: NVIDIA GP107M [GeForce GTX 1050 Ti Mobile] vendor: ASUSTeK 
  driver: N/A alternate: nouveau bus ID: 01:00.0 chip ID: 10de:1c8c 
  Device-3: IMC Networks USB2.0 HD UVC WebCam type: USB driver: uvcvideo 
  bus ID: 1-7:3 chip ID: 13d3:5666 serial: <filter> 
  Display: x11 server: X.Org 1.20.9 compositor: kwin_x11 driver: modesetting 
  alternate: fbdev,intel,vesa display ID: :0 screens: 1 
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") 
  s-diag: 582mm (22.9") 
  Monitor-1: eDP-1 res: 1920x1080 hz: 120 dpi: 142 size: 344x193mm (13.5x7.6") 
  diag: 394mm (15.5") 
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.1.8 
  direct render: Yes 
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: ASUSTeK driver: snd_hda_intel 
  v: kernel alternate: snd_soc_skl,snd_sof_pci bus ID: 00:1f.3 
  chip ID: 8086:a348 
  Sound Server: ALSA v: k5.4.70-MANJARO 
Network:
  Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel 
  port: 5000 bus ID: 00:14.3 chip ID: 8086:a370 
  IF: wlo1 state: up mac: <filter> 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASUSTeK driver: r8169 v: kernel port: 3000 bus ID: 03:00.0 
  chip ID: 10ec:8168 
  IF: enp3s0 state: down mac: <filter> 
Drives:
  Local Storage: total: 1.14 TiB used: 179.86 GiB (15.4%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/nvme0n1 model: CUK 250GB size: 232.89 GiB block size: 
  physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 serial: <filter> 
  rev: SVN105 scheme: GPT 
  ID-2: /dev/sda vendor: Western Digital model: WDS100T2B0A-00SM50 
  size: 931.51 GiB block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s 
  serial: <filter> rev: 20WD scheme: GPT 
Partition:
  ID-1: / raw size: 223.79 GiB size: 219.28 GiB (97.98%) 
  used: 13.64 GiB (6.2%) fs: ext4 dev: /dev/nvme0n1p2 
  ID-2: /home raw size: 791.62 GiB size: 778.20 GiB (98.30%) 
  used: 166.22 GiB (21.4%) fs: ext4 dev: /dev/sda1 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 8.80 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/nvme0n1p3 
Sensors:
  System Temperatures: cpu: 69.0 C mobo: 27.8 C 
  Fan Speeds (RPM): cpu: 0 
Info:
  Processes: 286 Uptime: 27m Memory: 15.50 GiB used: 2.45 GiB (15.8%) 
  Init: systemd v: 246 Compilers: gcc: 10.2.0 Packages: 1226 pacman: 1214 
  lib: 340 flatpak: 8 snap: 4 Shell: Bash v: 5.0.18 running in: konsole 
  inxi: 3.1.05 

Additionally, if I boot up running a kernel installed directly from System Settings>Kernel, for example kernel 5.4.67-1, nvidia drivers work just fine and I don’t get any Errors with sudo nvidia-settings or nvidia-smi commands, also I can’t open Nvidia X Server app when running the patched kernel, but with 5.4.67-1 I can open it with no issues.

Manjaro does not support custom kernel configurations.

But in general you would have to also build the nvidia extramodules for your kernel.

1 Like

You were right, only needed to build the nvidia driver’s modules and now everything works perfect. thanks a lot.

Just asking because it’s what I am using right now — would Liquorix (lqx) count as a custom kernel?

(On hindsight, seeing it benched I might just go back to regular Linux kernel releases)

I’ve marked the below answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (I just want to avoid even more subjective opinions being posted and confusing you even more)

:innocent:
P.S. In the future, please please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most :
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.

Yes. Only officially supported kernels are the ones in the repository.

Yes, I did mark it as the solution because I literally did what he said to solve the problem. Thanks for the advice anyways.

1 Like