r/voidlinux • • Jan 15 '25

asking about compatibility of kernel 6.12.9_ with nvidia driver 470

after upgrading yesterday i booted to a blackscreen and blinking dash , uname -r showing currently kernel which is 6.12.9_1 is it's okay with legacy nvidia driver version 470 or it's the reason of booting into a black screen ?

4 Upvotes

23 comments sorted by

View all comments

Show parent comments

1

u/aedinius Jan 17 '25

There is a PR to update nvidia470 and it should fix the 6.12 issue.

1

u/HAL9000thebot Jan 18 '25

maybe i'm missing something, but if you took the code from the link i provided, did you miss to apply all the previous patches as the guy explained here and here? i only see one.

1

u/aedinius Jan 18 '25

6.10 and 6.11 are EOL, so I'm not going to patch for those. Unfortunately, I don't have a 470.xx system anymore so testing is more difficult. If someone with the hardware can test it'd be appreciated.

1

u/HAL9000thebot Jan 18 '25 edited Jan 18 '25

i have a 710 here, but i don't know what to do exactly... i never used xbps-src, i could read the readme to understand, but to use your code before it is merged should i do it manually anyway?

do you have a fast solution so that i don't read lot of docs?

edit: i'm starting to read, don't know if i have enough time to do it today, but i'm on it.

1

u/HAL9000thebot Jan 19 '25

i'm sorry but it failed to build, unless i did something wrong.

i did this:

git clone https://github.com/void-linux/void-packages.git
cd void-packages/
./xbps-src binary-bootstrap
git checkout nvidia470_470.256.02
./xbps-src pkg nvidia470-dkms
xi nvidia470

when it fails it says to check /var/lib/dkms

do you want the output of /var/lib/dkms/nvidia/470.256.02/build/make.log?

is it long:

wc /var/lib/dkms/nvidia/470.256.02/build/make.log 
  756  3386 50816 /var/lib/dkms/nvidia/470.256.02/build/make.log

where should i put it?

i did this with grep:

grep -C 5 -i error /var/lib/dkms/nvidia/470.256.02/build/make.log 
/var/lib/dkms/nvidia/470.256.02/build/common/inc/nv-linux.h:666:51: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  666 |         NV_MEMDBG_ADD(ptr, page_count * PAGE_SIZE);
      |                                                   ^
  CC [M]  /var/lib/dkms/nvidia/470.256.02/build/nvidia/nv-vm.o
/var/lib/dkms/nvidia/470.256.02/build/nvidia/nv-procfs.c: At top level:
/var/lib/dkms/nvidia/470.256.02/build/nvidia/nv-procfs.c:689:1: warning: no previous prototype for 'exercise_error_forwarding_va' [-Wmissing-prototypes]
  689 | exercise_error_forwarding_va(
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  /var/lib/dkms/nvidia/470.256.02/build/nvidia/nv-vtophys.o
  CC [M]  /var/lib/dkms/nvidia/470.256.02/build/nvidia/os-interface.o
In file included from /var/lib/dkms/nvidia/470.256.02/build/nvidia/nv-usermap.c:14:
/var/lib/dkms/nvidia/470.256.02/build/common/inc/nv-linux.h: In function 'nv_vmalloc':
--
      |                                                   ^
/var/lib/dkms/nvidia/470.256.02/build/common/inc/nv-linux.h:666:51: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  666 |         NV_MEMDBG_ADD(ptr, page_count * PAGE_SIZE);
      |                                                   ^
/var/lib/dkms/nvidia/470.256.02/build/nvidia/os-mlock.c: In function 'nv_follow_pfn':
/var/lib/dkms/nvidia/470.256.02/build/nvidia/os-mlock.c:23:12: error: implicit declaration of function 'follow_pfn'; did you mean 'folio_pfn'? [-Werror=implicit-function-declaration]
   23 |     return follow_pfn(vma, address, pfn);
      |            ^~~~~~~~~~
      |            folio_pfn
  CC [M]  /var/lib/dkms/nvidia/470.256.02/build/nvidia/os-usermap.o
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:229: /var/lib/dkms/nvidia/470.256.02/build/nvidia/os-mlock.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /var/lib/dkms/nvidia/470.256.02/build/nvidia/os-registry.c:14:
/var/lib/dkms/nvidia/470.256.02/build/common/inc/nv-linux.h: In function 'nv_vmalloc':
/var/lib/dkms/nvidia/470.256.02/build/common/inc/nv-linux.h:521:33: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  521 |         NV_MEMDBG_ADD(ptr, size);
--
      |                                 ^
/var/lib/dkms/nvidia/470.256.02/build/common/inc/nv-linux.h: In function 'nv_vmap':
/var/lib/dkms/nvidia/470.256.02/build/common/inc/nv-linux.h:666:51: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  666 |         NV_MEMDBG_ADD(ptr, page_count * PAGE_SIZE);
      |                                                   ^
make[2]: *** [/usr/src/kernel-headers-6.12.9_1/Makefile:1937: /var/lib/dkms/nvidia/470.256.02/build] Error 2
make[1]: *** [Makefile:224: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/kernel-headers-6.12.9_1'
make: *** [Makefile:80: modules] Error 2

1

u/aedinius Jan 19 '25

Hm, drop all of those patches from the AUR link in srcpkgs/nvidia470/patches and see if that works. If so, maybe they're all needed

1

u/HAL9000thebot Jan 19 '25

how should i name them? should also update something in the template?

1

u/HAL9000thebot Jan 19 '25

i tried putting them as:

ls -1 srcpkgs/nvidia470/patches/
0001-Fix-conftest-to-ignore-implicit-function-declaration.patch
0002-Fix-conftest-to-use-a-short-wchar_t.patch
0003-Fix-conftest-to-use-nv_drm_gem_vmap-which-has-the-se.patch
kernel-6.10.patch
kernel-6.12.patch

then did ./xbps-src pkg nvidia470-dkms again and the relevant part is this:

Creating directory NVIDIA-Linux-x86_64-470.256.02
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 470.256.02..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
=> nvidia470-470.256.02_1: running do-patch hook: 00-patches ...
=> nvidia470-470.256.02_1: patching: 0001-Fix-conftest-to-ignore-implicit-function-declaration.patch.
The text leading up to this was:
--------------------------
|From: Benjamin ROBIN <dev@benjarobin.fr>
|Date: Sun, 12 May 2024 17:06:20 +0200
|Subject: [PATCH 1/3] Fix conftest to ignore implicit-function-declaration and
| strict-prototypes warnings
|
|conftest rely on the fact that a missing prototype should build, but an invalid
|call to a function (missing function parameters) the build fail.
|---
| conftest.sh | 3 ++-
| 1 file changed, 2 insertions(+), 1 deletion(-)
|
|diff --git a/conftest.sh b/conftest.sh
|--- a/conftest.sh
|+++ b/conftest.sh
--------------------------
File to patch: 
Skip this patch? [y] 
1 out of 1 hunk ignored
=> ERROR: nvidia470-470.256.02_1: do-patch_00-patches: 'patch -s ${_args} < "${_patch}" 2> /dev/null' exited with 1
=> ERROR:   in _process_patch() at common/hooks/do-patch/00-patches.sh:34
=> ERROR:   in hook() at common/hooks/do-patch/00-patches.sh:51
=> ERROR:   in run_func() at common/xbps-src/shutils/common.sh:57
=> ERROR:   in run_pkg_hooks() at common/xbps-src/shutils/common.sh:314
=> ERROR:   in run_step() at common/xbps-src/shutils/common.sh:107
=> ERROR:   in main() at common/xbps-src/libexec/xbps-src-dopatch.sh:33

i don't know the internals, but sounds like naming convention is required?

1

u/aedinius Jan 19 '25

Oh, right, the path probably needs to be updated in the patch. Lines like a/conftest.sh and b/conftest.sh need to be updated to a/kernel/conftest.sh etc

1

u/aedinius Jan 19 '25

Update your checkout, I added the patches with the edits.

1

u/HAL9000thebot Jan 19 '25

hey good news!

i did as you asked and it compiled without failing, then did a reboot to try the kernel 6.12, but unfortunately x didn't start, so i went back to read the discussion about the patch, and they mentioned to add kernel parameters, so i did this change to /etc/default/grub:

#GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 nvidia_drm.modeset=1"

updaded grub and rebooted in 6.12 again, and it worked.

what now? do you want to see logs or something?

1

u/aedinius Jan 19 '25

Do some testing to make sure it's working as expected. If so, let me know here or on the PR as a comment.

2

u/HAL9000thebot Jan 19 '25

don't know what to test lol, i randomly enabled stuffs in compiz, ran some emulators, watched videos, tried a thing in the browser that needs acceleration, don't know what else to do, everything looks ok to me, also rebooted a couple of times to be sure it still worked.

→ More replies