web-dev-qa-db-ja.com

Nvidiaドライバーはメインラインカーネルでは動作しません

Btrfsファイルシステムのいくつかの新機能を試したいのですが、それを行うにはUbuntu 12.04に含まれているよりも新しいカーネルを使用する必要があります。そのために、メインラインカーネルダウンロード here からlinux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deblinux-headers-3.4.0-030400-generic_3.4.0-030400.201205210521_AMD64.deb、およびlinux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_AMD64.debをインストールしました。

ただし、3.4カーネルで再起動すると、デスクトップの解像度が非常に低くなり、完全に上げることができません。これは最初にインストールしたときに起こりましたが、nvidia-currentパッケージを簡単にインストールすると、GTX570カードですべてがうまく機能しました。カーネルのインストール時にいくつかのDKMSエラーが発生したようで、/var/lib/dkms/nvidia-current/295.40/build/make.logを確認する必要があることが示されました。

josh@sirius:~/Downloads$ Sudo dpkg -i linux-*.deb
Selecting previously unselected package linux-headers-3.4.0-030400.
(Reading database ... 309400 files and directories currently installed.)
Unpacking linux-headers-3.4.0-030400 (from linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb) ...
Selecting previously unselected package linux-headers-3.4.0-030400-generic.
Unpacking linux-headers-3.4.0-030400-generic (from linux-headers-3.4.0-030400-generic_3.4.0-030400.201205210521_AMD64.deb) ...
Selecting previously unselected package linux-image-3.4.0-030400-generic.
Unpacking linux-image-3.4.0-030400-generic (from linux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_AMD64.deb) ...
Done.
Setting up linux-headers-3.4.0-030400 (3.4.0-030400.201205210521) ...
Setting up linux-headers-3.4.0-030400-generic (3.4.0-030400.201205210521) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic
ERROR (dkms apport): kernel package linux-headers-3.4.0-030400-generic is not supported
Error! Bad return status for module build on kernel: 3.4.0-030400-generic (x86_64)
Consult /var/lib/dkms/nvidia-current/295.40/build/make.log for more information.
Setting up linux-image-3.4.0-030400-generic (3.4.0-030400.201205210521) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic
ERROR (dkms apport): kernel package linux-headers-3.4.0-030400-generic is not supported
Error! Bad return status for module build on kernel: 3.4.0-030400-generic (x86_64)
Consult /var/lib/dkms/nvidia-current/295.40/build/make.log for more information.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic
update-initramfs: Generating /boot/initrd.img-3.4.0-030400-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.4.0-030400-generic
Found initrd image: /boot/initrd.img-3.4.0-030400-generic
Found linux image: /boot/vmlinuz-3.2.0-24-generic
Found initrd image: /boot/initrd.img-3.2.0-24-generic
Found memtest86+ image: /memtest86+.bin
Found Ubuntu 12.04 LTS (12.04) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
Found Windows 7 (loader) on /dev/sda3
done

/var/lib/dkms/nvidia-current/295.40/build/make.log

DKMS make.log for nvidia-current-295.40 for kernel 3.4.0-030400-generic (x86_64)
Thu Jun  7 00:58:39 BST 2012
NVIDIA: calling KBUILD...
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (        \
    echo;                               \
    echo "  ERROR: Kernel configuration is invalid.";       \
    echo "         include/generated/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-current/295.40/build/.tmp_versions ; rm -f /var/lib/dkms/nvidia-current/295.40/build/.tmp_versions/*
make -f scripts/Makefile.build obj=/var/lib/dkms/nvidia-current/295.40/build
  cc -Wp,-MD,/var/lib/dkms/nvidia-current/295.40/build/.nv.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/include -I/usr/src/linux-headers-3.4.0-030400-generic/Arch/x86/include -Iarch/x86/include/generated -Iinclude  -include /usr/src/linux-headers-3.4.0-030400-generic/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -I/var/lib/dkms/nvidia-current/295.40/build -Wall -MD -Wsign-compare -Wno-cast-qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"295.40\" -Wno-unused-function -Wuninitialized -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(nv)"  -D"KBUILD_MODNAME=KBUILD_STR(nvidia)" -c -o /var/lib/dkms/nvidia-current/295.40/build/.tmp_nv.o /var/lib/dkms/nvidia-current/295.40/build/nv.c
In file included from include/linux/kernel.h:19:0,
                 from include/linux/sched.h:55,
                 from include/linux/utsname.h:35,
                 from /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:38,
                 from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13:
include/linux/bitops.h: In function ‘hweight_long’:
include/linux/bitops.h:66:41: warning: signed and unsigned type in conditional expression [-Wsign-compare]
In file included from /usr/src/linux-headers-3.4.0-030400-generic/Arch/x86/include/asm/uaccess.h:577:0,
                 from include/linux/poll.h:14,
                 from /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:97,
                 from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13:
/usr/src/linux-headers-3.4.0-030400-generic/Arch/x86/include/asm/uaccess_64.h: In function ‘copy_from_user’:
/usr/src/linux-headers-3.4.0-030400-generic/Arch/x86/include/asm/uaccess_64.h:53:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In file included from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13:0:
/var/lib/dkms/nvidia-current/295.40/build/nv-linux.h: At top level:
/var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:114:75: fatal error: asm/system.h: No such file or directory
compilation terminated.
make[3]: *** [/var/lib/dkms/nvidia-current/295.40/build/nv.o] Error 1
make[2]: *** [_module_/var/lib/dkms/nvidia-current/295.40/build] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [module] Error 2
7
dutchie

(コメントでブルーノが示唆したように、私自身の質問に答える)

この問題は、以下の手順に従って、Nvidiaが提供するドライバーを手動でインストールすることで修正されます。

  1. Nvidia Webサイト からドライバーをダウンロードします
  2. Xの実行中にドライバーがインストールされないため、回復モードで再起動します。これを行うには、再起動し、必要に応じてGrubに入るためにShiftキーを押しながら、回復オプションを選択してから、テキストメニューの「ルートシェル」を選択します。
  3. これで、次のようなシェルに直面するはずです。

    root@sirius:~# 
    

    次のコマンドを入力して、ルートファイルシステムが書き込み可能になるようにします。

    mount -o rw,remount /
    
  4. いくつかの必要なパッケージをインストールします(ネットワークを事前に起動するには、dhclient eth0が必要になる場合があります)。

    apt-get install dkms
    
  5. Nvidiaインストーラーを実行可能にして実行します。

    chmod +x $INSTALLER_FILE
    ./$INSTALLER_FILE
    

    ここで、$INSTALLER_FILEは、インストーラーのダウンロード先です(タブ補完を使用して、おそらく/home/josh/Downloads/NVIDIA-Linux-x86_64-302.17.runのようなものを使用します)

  6. インストーラーの手順を実行します。デフォルトが機能するはずです。

  7. 通常のシステムで再起動します。
8
dutchie