dkms can't build nvidia modules in 2.6.31-20-generic

Bug #532231 reported by Bremm
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

While installing a new kernel available by update-manager, console screen shows an error:

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
 * Running DKMS auto installation service for kernel 2.6.31-20-generic

 * nvidia (185.18.36)...
nvidia (185.18.36): Installing module.
........(bad exit status: 10)
  Build failed. Installation skipped.
   ...fail!

So I tried to do manually:

$ sudo dkms build -m nvidia -v 185.18.36 -k 2.6.31-20-generic

Kernel preparation unnecessary for this kernel. Skipping...
applying patch rt_preempt_31.patch...patching file nv-linux.h

applying patch fall_back_on_mtrr_if_no_pat.patch...patching file nv.c
Hunk #1 succeeded at 891 (offset -49 lines).

applying patch nvidia-rt-compat.patch...patching file os-interface.c

Building module:
cleaning build area....
su nobody -c "make KERNELRELEASE=2.6.31-20-generic module KERNDIR=/lib/modules/2.6.31-20-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/2.6.31-20-generic/build".....(bad exit status: 2)

Error! Bad return status for module build on kernel: 2.6.31-20-generic (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/nvidia/185.18.36/build/ for more information.
0
0

And that's the reason:

$ cat /var/lib/dkms/nvidia/185.18.36/build/make.log
DKMS make.log for nvidia-185.18.36 for kernel 2.6.31-20-generic (x86_64)
Qui Mar 4 18:40:23 BRT 2010
NVIDIA: calling KBUILD...
make CC=cc KBUILD_VERBOSE=1 -C /lib/modules/2.6.31-20-generic/build SUBDIRS=/var/lib/dkms/nvidia/185.18.36/build modules
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
 echo; \
 echo " ERROR: Kernel configuration is invalid."; \
 echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
 echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
 echo; \
 /bin/false)
mkdir -p /var/lib/dkms/nvidia/185.18.36/build/.tmp_versions ; rm -f /var/lib/dkms/nvidia/185.18.36/build/.tmp_versions/*
make -f scripts/Makefile.build obj=/var/lib/dkms/nvidia/185.18.36/build
cp /var/lib/dkms/nvidia/185.18.36/build/nv-kernel.o /var/lib/dkms/nvidia/185.18.36/build/nv-kernel.o
cp: impossível obter estado de `/var/lib/dkms/nvidia/185.18.36/build/nv-kernel.o': Arquivo ou diretório não encontrado
make[3]: ** [/var/lib/dkms/nvidia/185.18.36/build/nv-kernel.o] Erro 1
make[2]: ** [_module_/var/lib/dkms/nvidia/185.18.36/build] Erro 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: ** [module] Erro 1
make: ** [module] Erro 2

But, as you can see, the needed files are there:

bremm@host:~$ locate autoconf.h auto.conf
/usr/src/linux-headers-2.6.31-19-generic/include/config/auto.conf
/usr/src/linux-headers-2.6.31-19-generic/include/config/auto.conf.cmd
/usr/src/linux-headers-2.6.31-19-generic/include/linux/autoconf.h
/usr/src/linux-headers-2.6.31-20-generic/include/config/auto.conf

Seems to be a dkms issue, but I'm not sure about. autoconf is 2.64 and dkms is 2.1.0.1 on Xubuntu 9.10 amd64.

$ lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10

$ apt-cache policy autoconf
autoconf:
  Instalado: 2.64-1ubuntu1
  Candidato: 2.64-1ubuntu1
  Tabela de versão:
 *** 2.64-1ubuntu1 0
        500 http://br.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

$ apt-cache policy dkms
dkms:
  Instalado: 2.1.0.1-0ubuntu1
  Candidato: 2.1.0.1-0ubuntu1
  Tabela de versão:
 *** 2.1.0.1-0ubuntu1 0
        500 http://br.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status
/usr/src/linux-headers-2.6.31-20-generic/include/config/auto.conf.cmd
/usr/src/linux-headers-2.6.31-20-generic/include/linux/autoconf.h

affects: ubuntu → dkms (Ubuntu)
Revision history for this message
Peter Hurley (phurley) wrote :

This has been addressed in lucid's dkms package (2.1.1.1). The issue is that 'su nobody make...' doesn't work in this context and so has been stripped to simply 'make...'.

Revision history for this message
Bremm (bremm) wrote :

I've just done with dkms_2.1.1.2-0ubuntu1_all.deb and still doesn't work (tried as root also).

$ sudo dkms build -m nvidia -v 185.18.36 -k 2.6.31-20-generic

Kernel preparation unnecessary for this kernel. Skipping...
applying patch rt_preempt_31.patch...patching file nv-linux.h

applying patch fall_back_on_mtrr_if_no_pat.patch...patching file nv.c
Hunk #1 succeeded at 891 (offset -49 lines).

applying patch nvidia-rt-compat.patch...patching file os-interface.c

Building module:
cleaning build area....
make KERNELRELEASE=2.6.31-20-generic module KERNDIR=/lib/modules/2.6.31-20-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/2.6.31-20-generic/build.....(bad exit status: 2)

Error! Bad return status for module build on kernel: 2.6.31-20-generic (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/nvidia/185.18.36/build/ for more information.
0
0

I'll uninstall this kernel version (wanted it to try with my usb hard disk) and will wait for lucid.

Thank you for helping.

Revision history for this message
Peter Hurley (phurley) wrote :

@Bremm

With dkms fixed, it's better to run it as su root (rather than sudo). dkms looks at the environment (eg, $SYSSRC), but sudo doesn't copy the environment over - for good reason. I did note that you ran dkms as root as well.

When you run it as root, what's in the make.log ( /var/lib/dkms/nvidia/185.18.36/build ) ?

NB - For kernels>=2.6.33, there are several other build problems to overcome. I'll link to a different bug for that though.

Revision history for this message
Bremm (bremm) wrote :

Last attempt (as root) gave me this:

make CC=cc KBUILD_VERBOSE=1 -C /lib/modules/2.6.31-20-generic/build SUBDIRS=/var/lib/dkms/nvidia/185.18.36/build modules
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
 echo; \
 echo " ERROR: Kernel configuration is invalid."; \
 echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
 echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
 echo; \
 /bin/false)

But the weirdest came after: I tried to run 'make oldconfig && make prepare' and it didn't work. Too bad I can't reproduce this again, because I've cleaned up the system before try 'update-nanager -d' (and it didn't work also). :-(

Revision history for this message
Bremm (bremm) wrote :

Now running on lucid. It seems dkms finally could handle the module building.

$ lsb_release -d
Description: Ubuntu lucid (development branch)

$ dkms -V
dkms: 2.1.1.2

By the way, safe-rm almost jeopardized my system, since it relies on perl-modules and something related to perl had been broken, leading the update process to an infinite error looping. Fortunately, 'dpkg -r safe-rm' saved my day.

Changed in dkms (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.