[BUG] NVIDIA 440.26 modules not building

I just updated to v440.26 from 435.21 (which installs fine), to find out that the modules fail to compile on my system. Strangely, the common/inc/nv-linux.h include file attempts to #include <asm/system.h>, which has long been deprecated (I’m using Linux v5.3.6 with matching kernel headers in /usr/include/asm).

So, I changed “#if defined(NV_ASM_SYSTEM_H_PRESENT)” for “#if 0” in common/inc/nv-linux.h, and was then faced with another issue in nvidia-uvm/uvm_linux.h which tries to #include <asm/powernv.h>, here again while that header does not exist any more…

I changed “#if defined(NV_PNV_NPU2_INIT_CONTEXT_PRESENT)” for “#if 0” in nvidia-uvm/uvm_linux.h and could, at last, compile the modules (which seem to be running just fine)…

It looks like you guys at NVIDIA broke the kernel headers detection in 440.26… :-/

Attaching the installer log.
nvidia-installer.log.gz (11 KB)

Those are correct conditional includes. CONFTEST checks for files and kernel options and sets the variables:

#if defined(NV_ASM_SYSTEM_H_PRESENT)
#include <asm/system.h>             /* cli, sli, save_flags             */

meaning if asm/system.h is present, include it.

No, they are not “correct”, since they fail to detect the absence of the corresponding include files… Obviously, something got changed in v440.26 build scripts, that broke the modules building. It has been many, many years I have been building NVIDIA modules on many different Linux systems/computers, and I never encountered such an issue so far…

I’m just telling that you’re fiddling at the symptom, not the reason. The include by itself is correct, it’s just the question why NV_ASM_SYSTEM_H_PRESENT gets defined on your system when it shouldn’t.

Same issue on Ubuntu 19.10 with nvidia-440. Downloaded from graphics-team ppa

I’m using vanilla kernel 5.3.7 on Fedora 30 and everything builds just fine.

Must be a/an Ubuntu specific issue - file a bug report on Launchpad.

This is NOT specific to a distro. Building my own kernels here, and not using Ubuntu either…

Thank you for stating the obvious…

NV_ASM_SYSTEM_H_PRESENT is NOT defined in the Linux systems: it is by the build system of the NVIDIA kernel modules, and obviously wrongly.

Its an internationlization error in conftest.sh

Heres a patch:

diff -Naur nvidia-440.26.old/conftest.sh nvidia-440.26/conftest.sh
--- nvidia-440.26.old/conftest.sh       2019-10-18 19:40:32.256867243 +0200
+++ nvidia-440.26/conftest.sh   2019-10-17 23:51:22.206328310 +0200
@@ -70,7 +70,7 @@
         CODE="#include <$file>"

         echo "$CODE" > conftest_headers$$.c
-        $CC $CFLAGS -c conftest_headers$$.c > conftest_headers$$.log 2>&1
+        LANG=C $CC $CFLAGS -c conftest_headers$$.c > conftest_headers$$.log 2>&1

         if [ -f conftest_headers$$.o ]; then
             rm -f conftest_headers$$.o

Well spotted !

Thanks for reporting this. For reference we’re tracking the fix in internal bug 2733901.

Just to add my feedback, I had this problem yesterday too installing on Ubuntu 19.04 with

sudo ubuntu-drivers autoinstall

I follow the log errors and found the same.

#include <asm/system.h>             /* cli, sli, save_flags             */

using a not older than 2 years pc, configured with spanish.

I guess it will be solved in hours/days.

Regards,

could notinstall the driver 440.26 on kernel 4.14 with ppa , but i did it with .run file .everything works as expected here .
thank U devs

fixed in latest version on ubuntu ppa. did not checked the latest .run file but I guess it is also solved

//closed

Note:
The addition of “LANG=C” is not a good enough guarantee that the modules will build: on one of my systems I also had to add: LANGUAGE=C

If your distribution or you yourself sets the LC_ALL environment in /etc/profile or something similar setting LANG cannot overwrite LC_MESSAGES and the bug resists. This is not recommended by the GNU gettext folks.
But you are right. The setting of LANGUAGE instead of LANG should fix this behaviour. If the autotools folks do it, we can do this too.

So

diff -Naur nvidia-440.26.old/conftest.sh nvidia-440.26/conftest.sh
--- nvidia-440.26.old/conftest.sh       2019-10-18 19:40:32.256867243 +0200
+++ nvidia-440.26/conftest.sh   2019-10-17 23:51:22.206328310 +0200
@@ -70,7 +70,7 @@
         CODE="#include <$file>"

         echo "$CODE" > conftest_headers$$.c
-        $CC $CFLAGS -c conftest_headers$$.c > conftest_headers$$.log 2>&1
+        LANGUAGE=C $CC $CFLAGS -c conftest_headers$$.c > conftest_headers$$.log 2>&1

         if [ -f conftest_headers$$.o ]; then
             rm -f conftest_headers$$.o

should be correct