我想尝试 btrfs 文件系统中的一些新功能,为此我需要使用比 Ubuntu 12.04 中更新的内核。为此,我安装了linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb
、linux-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
答案1
(回答我自己的问题,正如 Bruno 在评论中所建议的那样)
按照以下步骤手动安装 Nvidia 提供的驱动程序可以解决此问题。
- 从以下位置下载驱动程序Nvidia 网站
- 重新启动进入恢复模式,因为在运行 X 时驱动程序无法安装。重新启动后,按住 Shift 键(如果需要)进入 Grub,选择恢复选项,然后在文本菜单中选择“Root shell”。
你现在应该面对一个类似这样的 shell:
root@sirius:~#
输入以下命令以使根文件系统可写:
mount -o rw,remount /
安装一些必需的软件包(您可能需要
dhclient eth0
预先启动网络):apt-get install dkms
使 Nvidia 安装程序可执行并运行它:
chmod +x $INSTALLER_FILE ./$INSTALLER_FILE
安装程序的下载位置在哪里
$INSTALLER_FILE
(使用制表符补全来帮助您,可能类似于/home/josh/Downloads/NVIDIA-Linux-x86_64-302.17.run
)按照安装程序中的步骤操作。默认设置即可。
- 重新启动进入正常系统。