You are not logged in.

#1 2024-05-08 17:44:50

bostjan
Member
Registered: 2024-04-02
Posts: 5

[SOLVED] nvidia-390xx-dkms build failure

nvidia-390xx-dkms fails to compile on 6.8.9-arch1-2 and 6.6.30-1-lts kernels

https://pastebin.com/SeUQ64Gn

Last edited by bostjan (2024-05-09 11:38:23)

Offline

#2 2024-05-08 20:47:29

injiniero
Member
Registered: 2022-04-26
Posts: 10

Re: [SOLVED] nvidia-390xx-dkms build failure

Same error with nvidia-470xx-dkms on 6.8.9-arch1-2

https://pastebin.com/Eb2MZ7U1

Offline

#3 2024-05-08 22:52:21

loqs
Member
Registered: 2014-03-06
Posts: 17,605

Re: [SOLVED] nvidia-390xx-dkms build failure

https://forums.developer.nvidia.com/t/n … -up/279072
https://github.com/NVIDIA/open-gpu-kern … 4b36f13dd5

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 093704c..a9db899 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -153,7 +153,8 @@ test_headers() {
 build_cflags() {
     BASE_CFLAGS="-O2 -D__KERNEL__ \
 -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
--nostdinc -isystem $ISYSTEM"
+-nostdinc -isystem $ISYSTEM \
+-Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-incompatible-pointer-types"
 
     if [ "$OUTPUT" != "$SOURCES" ]; then
         OUTPUT_CFLAGS="-I$OUTPUT/include2 -I$OUTPUT/include"

Offline

#4 2024-05-09 10:03:29

TechXero
Member
Registered: 2022-05-20
Posts: 26

Re: [SOLVED] nvidia-390xx-dkms build failure

How to apply this ? Am not a dev so no clue

Offline

#5 2024-05-09 10:23:07

loqs
Member
Registered: 2014-03-06
Posts: 17,605

Re: [SOLVED] nvidia-390xx-dkms build failure

Offline

#6 2024-05-09 10:29:07

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,020

Re: [SOLVED] nvidia-390xx-dkms build failure

copy the diff loqs posted to a textfile and give it a meaningful name, say gcc14.patch

put gcc14.patch in the folder you build nvidia-390xx-utils from , add it to the source= array of the PKGBUILD and regenerate checksums.

Then add a command to prepare() to apply the patch and test if it builds .

ADDED: For more info follow the link posted by loqs just above this post.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2024-05-09 11:08:47

TechXero
Member
Registered: 2022-05-20
Posts: 26

Re: [SOLVED] nvidia-390xx-dkms build failure

I use 470xx Drivers but ok.. Or downgrade to GCC 13.2.1 n wait it out lol..

Offline

#8 2024-05-09 11:36:05

bostjan
Member
Registered: 2024-04-02
Posts: 5

Re: [SOLVED] nvidia-390xx-dkms build failure

I can confirm that the patch above works. Thanks!

Offline

#9 2024-05-09 14:15:45

TempusNemini
Member
From: Moon
Registered: 2023-07-16
Posts: 13

Re: [SOLVED] nvidia-390xx-dkms build failure

Thanks, patch is working and pretty easy to install.

Offline

#10 2024-05-09 17:37:58

injiniero
Member
Registered: 2022-04-26
Posts: 10

Re: [SOLVED] nvidia-390xx-dkms build failure

Patch for nvidia-470xx-dkms

--- a/kernel/conftest.sh	2024-05-09 15:36:56.531998145 +0200
+++ b/kernel/conftest.sh	2024-05-09 15:38:08.555897819 +0200
@@ -101,7 +101,8 @@
 build_cflags() {
     BASE_CFLAGS="-O2 -D__KERNEL__ \
 -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
--nostdinc -isystem $ISYSTEM"
+-nostdinc -isystem $ISYSTEM \
+-Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-incompatible-pointer-types"
 
     if [ "$OUTPUT" != "$SOURCES" ]; then
         OUTPUT_CFLAGS="-I$OUTPUT/include2 -I$OUTPUT/include"

Offline

#11 2024-05-10 06:08:10

triccsr
Member
Registered: 2023-10-08
Posts: 6

Re: [SOLVED] nvidia-390xx-dkms build failure

loqs wrote:

https://forums.developer.nvidia.com/t/n … -up/279072
https://github.com/NVIDIA/open-gpu-kern … 4b36f13dd5

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 093704c..a9db899 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -153,7 +153,8 @@ test_headers() {
 build_cflags() {
     BASE_CFLAGS="-O2 -D__KERNEL__ \
 -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
--nostdinc -isystem $ISYSTEM"
+-nostdinc -isystem $ISYSTEM \
+-Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-incompatible-pointer-types"
 
     if [ "$OUTPUT" != "$SOURCES" ]; then
         OUTPUT_CFLAGS="-I$OUTPUT/include2 -I$OUTPUT/include"

It works for me, too. Thanks.

Offline

#12 2024-05-10 15:06:42

hikmateustad
Member
Registered: 2022-01-23
Posts: 29

Re: [SOLVED] nvidia-390xx-dkms build failure

Worked for me on 390.157

Offline

#13 2024-05-10 18:58:12

twilight0
Member
From: Greece
Registered: 2011-05-01
Posts: 233
Website

Re: [SOLVED] nvidia-390xx-dkms build failure

Do I have to do this on every DKMS update?

Last edited by twilight0 (2024-05-10 18:58:30)


Proud Arch Linux user since 2007.

Offline

#14 2024-05-10 19:00:23

loqs
Member
Registered: 2014-03-06
Posts: 17,605

Re: [SOLVED] nvidia-390xx-dkms build failure

twilight0 wrote:

Do I have to do this on every DKMS update?

No.

Offline

#15 2024-05-10 19:45:05

twilight0
Member
From: Greece
Registered: 2011-05-01
Posts: 233
Website

Re: [SOLVED] nvidia-390xx-dkms build failure

I am confused as to which procedure and which package I should patch. Do I have to use ABS? I haven't used ABS since 2011 for crying out loud.


Proud Arch Linux user since 2007.

Offline

#16 2024-05-10 19:54:01

seth
Member
Registered: 2012-09-03
Posts: 52,335

Re: [SOLVED] nvidia-390xx-dkms build failure

nvidia-390xx* is a split package, you can add the patch to its PKGBUILD or just fix kernel/conftest.sh (even manually. with vim) after the build failure and rebuild w/ "makepkg -e"
And since it's an AUR package you don't need to use ABS either. Or rather you can't.

Offline

#17 2024-05-10 20:32:39

twilight0
Member
From: Greece
Registered: 2011-05-01
Posts: 233
Website

Re: [SOLVED] nvidia-390xx-dkms build failure

I am struggling. Build still fails with "makepkg -e" Can't we just include the patch in the AUR package by default for seamless updates?


Proud Arch Linux user since 2007.

Offline

#18 2024-05-10 20:35:05

seth
Member
Registered: 2012-09-03
Posts: 52,335

Re: [SOLVED] nvidia-390xx-dkms build failure

"We" cannot.
The package maintainer can and probably will at some point.

"makepkg -e" doesn't fix the problem, it just prevents the sources from being overwritten after you edited the file.

Offline

#19 2024-05-10 21:44:04

loqs
Member
Registered: 2014-03-06
Posts: 17,605

Re: [SOLVED] nvidia-390xx-dkms build failure

seth wrote:

The package maintainer can and probably will at some point.

That may be delayed by the maintainer now having 'a more proper patch' to review as well,  quotes as changing the build flags for every unit instead of just the broken conftest.sh makes no sense to me and Nvidia itself is not using `-fpermissive`.

Offline

#20 2024-05-10 22:30:33

seth
Member
Registered: 2012-09-03
Posts: 52,335

Re: [SOLVED] nvidia-390xx-dkms build failure

The porting guide nowhere "recommends" to use fpermissive but hints it for

Sources that cannot be ported to standard C

and offers

Alternatively, individual errors can be downgraded to warnings using the relevant -Wno-error=… option, or disabled completely with -Wno-….

The only "more proper" patch is to fix up nvidia's code (some extern's might do)

Offline

#21 2024-05-11 20:10:15

twilight0
Member
From: Greece
Registered: 2011-05-01
Posts: 233
Website

Re: [SOLVED] nvidia-390xx-dkms build failure

seth wrote:

"makepkg -e" doesn't fix the problem, it just prevents the sources from being overwritten after you edited the file.

I tried building the package with the gcc14.patch and I am getting error at line 139 "cd NVIDIA.... (yadayada) No such file or directory"

Of course I added the checksum, the patch itself and the extra line at prepare() section


Proud Arch Linux user since 2007.

Offline

#22 2024-05-11 20:15:53

seth
Member
Registered: 2012-09-03
Posts: 52,335

Re: [SOLVED] nvidia-390xx-dkms build failure

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Post the actual PKGBUILD you created and the actual error/build log.

If you tried to run "makepkg -e" as first run with just a patched PKGBUILD and no downloaded sources, that's wrong.
In that case just run a regular "makepkg"

Offline

#23 2024-05-12 09:12:43

lefteris
Member
Registered: 2013-08-04
Posts: 17

Re: [SOLVED] nvidia-390xx-dkms build failure

Hey @twililight0 I suspect I know what your issue may have been as I have had a similar one and just solved it.

The PKGFILE of 470xx first does

cd kernel

and then applies the patches.

Which makes the patch not possible to apply if you just add it at the same place as the given patch in this topic is kernel/conftest.sh.

Either rename the patch file or move it before the cd.

Last edited by lefteris (2024-05-12 09:13:19)

Offline

#24 2024-05-12 11:38:51

DVDisco
Member
Registered: 2024-05-12
Posts: 1

Re: [SOLVED] nvidia-390xx-dkms build failure

Lone_Wolf wrote:

copy the diff loqs posted to a textfile and give it a meaningful name, say gcc14.patch

put gcc14.patch in the folder you build nvidia-390xx-utils from , add it to the source= array of the PKGBUILD and regenerate checksums.

Then add a command to prepare() to apply the patch and test if it builds .

ADDED: For more info follow the link posted by loqs just above this post.

When editing prepare() how to know the right directory to cd into and the correct path for the input argument of the patch command?

Offline

#25 2024-05-12 11:44:25

JoeHartley
Member
Registered: 2011-10-01
Posts: 24

Re: [SOLVED] nvidia-390xx-dkms build failure

For anyone needing more detailed instructions for the nvidia-470xx-* packages:

- Locate the directory the nvidia-470xx-utils package gets built in.  I use trizen, so my directory was ~/.cache/trizen/nvidia-470xx-utils/

- Create the file gcc14.patch with the contents:

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 093704c..a9db899 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -153,7 +153,8 @@ test_headers() {
 build_cflags() {
     BASE_CFLAGS="-O2 -D__KERNEL__ \
 -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
--nostdinc -isystem $ISYSTEM"
+-nostdinc -isystem $ISYSTEM \
+-Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-incompatible-pointer-types"
 
     if [ "$OUTPUT" != "$SOURCES" ]; then
         OUTPUT_CFLAGS="-I$OUTPUT/include2 -I$OUTPUT/include"

- Get the checksum of your file with "sha512sum gcc14.patch"

- Edit the PKGBUILD file to make these changes:
     - Add "gcc14.patch" to the source section
     - Add the checksum you got above to the sha512sums section
    - Add this line in the prepare() section:
          patch -Np2 -i "../../gcc14.patch"

Then run "makepkg -fi" to build and install the -utils, opencl, and -dkms packages. 

The arguments to the patch command were different than the others, which was throwing me off.

Offline

Board footer

Powered by FluxBB