Linux new kernel 6.5.0-14(ubuntu 22.04) can not compile NVIDIA display card driver

help!!! Today, after I update the kernel from 6.2.0-39 to 6.5.0-14, I find the latest NVIDIA display driver (535.146.02, not ubunut repo’s driver) can not be installed by compile kernel errors. How can I solve this problem? wait NVIDIA to update drivers?


the error log promote: cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’
cc: error: unrecognized command-line option ‘-ftrivial-auto-var-init=zero’

Looks like you changed the system compiler to an incompatible one. Please post the output of
cc -v
gcc -v

gcc11, ubunut 22.04 current gcc version.

Then I guess the ubuntu kernel team used a wrong compiler, please post the output of
cat /proc/version

We are facing similar problems, although our errors differ from sakalaboator’s.

With ubuntu 22.04’s updated 6.5.0 kernel, nvidia-dkms-535 (with the nvidia-driver-535 installed from the NVIDIA repositories) can no longer compile. I get the attached error log.

It seems the get_user_pages function changed signature, which breaks compilation. Interestingly, the affected nv-mm.h file has a bunch of comments at the top listing similar past changes.

Any help appreciated, as this is blocking new installs.

1 Like

Now with the attachment.
nvidia-dkms-535.0.crash.txt (129.0 KB)

It seems none of the GCC version, because the 535 version driver can be compiled into 6.2 kernel with the same gcc version and parameters. From Ubuntu forum, someone says the driver in Ubuntu repo can be installed and run well. So I think the latest binary driver provided by NVIDIA has not been tested for new kernel. We can only 1. wait NVIDIA for new driver update, 2, install driver from Ubuntu repo. 3. fallback the kernel to 6.0.x

Same here, with ubuntu 22.04 but driver 390.157 (geforce 670M)
after an upgrade to kernel 6.5.0-14, tried to revert to the preceeding kernel with no luck.
The driver does not compile and first complains in the crash log are :
In file included from /var/lib/dkms/nvidia/390.157/build/common/inc/nv-linux.h:21,
from /var/lib/dkms/nvidia/390.157/build/nvidia/nv-gpu-numa.c:24:
/var/lib/dkms/nvidia/390.157/build/common/inc/nv-mm.h: In function ‘NV_GET_USER_PAGES_REMOTE’:
/var/lib/dkms/nvidia/390.157/build/common/inc/nv-mm.h:164:45: error: passing argument 1 of ‘get_user_pages_remote’ from incompatible pointer type [-Werror=incompatible-pointer-types]
164 | return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
| ^~~
| |
| struct task_struct *

1 Like

I guess i am joining this same list after powering on my computer after Ubuntu updates the night before my PC no longer boots into the Operating System: Ubuntu 22.04.3 LTS , using kernel Linux 6.5.0-14-generic ) My video card is a NVidia GF100 GTX480 using driver 390.157. I can SSH into it from another PC but it just wont boot into Ubuntu any longer. I am assuming this is the isssue being talked about here and would love to here that NVidia is aware and isnt going to give up on us old hardware guys just yet -Brian-

Same error with Ubuntu 22.04, Nvidia driver 525.147.05 and GCC 11 with this message in make.log :

warning: the compiler differs from the one used to build the kernel

I have switched to GGC 12 with
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --config gcc

And rebuild it with
sudo dkms autoinstall --kernelver 6.5.0-14-generic

And It works for me.

cat /proc/version :
Linux version 6.5.0-14-generic (buildd@lcy02-amd64-110) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2

gcc -v :
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

Does it mean i probably need to switch to gcc 12 too ?

it turns out i have both gcc-11 and gcc-12 installed, maybe not the right place to ask but is it safe to delete gcc-11 (in synaptic or command line) to force the use of gcc-12 ?

Same here with nvidia-driver-418-server and gcc 12.3.0

Loading new nvidia-418.226.00 DKMS files...
Building for 6.5.0-14-generic
Building for architecture x86_64
Building initial module for 6.5.0-14-generic
Error! Bad return status for module build on kernel: 6.5.0-14-generic (x86_64)

And with nvidia-driver-390 as well

same with nvidia-driver-390 and gcc 11

i have the same issue with ubuntu 22.04 [geforce 620m] nvidia-driver-390, running sudo apt install nvidia-driver-390 or sudo apt install nvidia-dkms-390 returns this error

dpkg: error processing package nvidia-dkms-390 (–configure): installed nvidia-dkms-390 package post-installation script subprocess returned

1 Like

You mean, GCC12 can compile the nvidia binary driver?

for my case i tried gcc 12 i still get the same error while building nvidia-driver-390

390 has not been supported by new GCC version.

Thanks Peshkopy. This error is resolved by gcc version update. Now it works well.

  1. gcc -v
    Using built-in specs.
    Target: x86_64-linux-gnu
    Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu 12.3.0-1ubuntu1~22.04’ --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-ALHxjy/gcc-12-12.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-ALHxjy/gcc-12-12.3.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    Supported LTO compression algorithms: zlib zstd
    gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04)
  2. nvidia-smi
    Mon Jan 15 09:19:11 2024
    | NVIDIA-SMI 535.146.02 Driver Version: 535.146.02 CUDA Version: 12.2 |

Glad to ear some of you resolved the problem :)
So … any ideas how one can fix the issue for 390 drivers ?