NVIDIAインストーラがカーネルソース/ビルドファイル(kernel.orgでコンパイル済み)を見つけることができません。

NVIDIAインストーラがカーネルソース/ビルドファイル(kernel.orgでコンパイル済み)を見つけることができません。

私はFedora 15システムにkernel.orgから新しい3.0-rc2カーネルをコンパイルしてインストールしました。すべてが正常に動作しているようで、システムで正常に起動できます。ただし、これにより以前にインストールされたNVIDIAドライバが破損したため、新しいドライバをコンパイルする必要がありました。 nvidia.comからインストーラをダウンロードしましたが、インストールに問題があります。

カーネルをコンパイルするために、カーネルアーカイブの圧縮をホームディレクトリに解凍し、新しいカーネルに対してFedora設定を再利用しました。すべてがあります~/linux_build/linux-3.0-rc2

ランレベル3で起動した後、NVIDIAインストーラでエラーが発生します。

ERROR: If you are using a Linux 2.4 kernel, please make sure
   you either have configured kernel sources matching your
   kernel or the correct set of kernel headers installed
   on your system.

   If you are using a Linux 2.6 kernel, please make sure
   you have configured kernel sources matching your kernel
   installed on your system. If you specified a separate
   output directory using either the "KBUILD_OUTPUT" or
   the "O" KBUILD parameter, make sure to specify this
   directory with the SYSOUT environment variable or with
   the equivalent nvidia-installer command line option.

   Depending on where and how the kernel sources (or the
   kernel headers) were installed, you may need to specify
   their location with the SYSSRC environment variable or
   the equivalent nvidia-installer command line option.

次のようにインストーラを実行します。

bash NVIDIA-Linux-x86_64-270.41.19.run --kernel-source-path=/home/tja/linux_build/linux-3.0-rc2

通常、この問題はカーネルヘッダーをインストールすると解決されますが、yumここではRPMを使用できない新しいカーネルを使用しています。

NVIDIAインストーラに必要なヘッダ/ソースファイルを手動でインストールするにはどうすればよいですか?

ベストアンサー1

まあ、私はクレイジーではありません。 NVIDIA インストーラにパッチが必要です。カーネルバージョン2.7.0は上限にハードコードされています。簡単なパッチで3.1.0へのアップグレードが可能です。

パッチファイルは次のとおりです。nvidia-patch@fedoraforum.org

--- conftest.sh.orig    2011-05-30 12:24:39.770031044 -0400
+++ conftest.sh 2011-05-30 12:25:49.059315428 -0400
@@ -76,7 +76,7 @@
 }

 build_cflags() {
-    BASE_CFLAGS="-D__KERNEL__ \
+    BASE_CFLAGS="-O2 -D__KERNEL__ \
 -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
 -nostdinc -isystem $ISYSTEM"

--- nv-linux.h.orig 2011-05-30 12:27:09.341819608 -0400
+++ nv-linux.h  2011-05-30 12:27:28.854951411 -0400
@@ -32,7 +32,7 @@
 #  define KERNEL_2_4
 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
 #  error This driver does not support 2.5 kernels!
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 7, 0)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
 #  define KERNEL_2_6
 #else
 #  error This driver does not support development kernels!

次に、NVIDIAインストーラからファイルを抽出する必要があります。

./NVIDIA-Linux-x86_64-270.41.19.run -x

その後、「kernel」ディレクトリにはパッチが必要なファイルがあります。

cd NVIDIA-Linux-x86_64-270.41.19/kernel/
patch -p0 kernel-3.0-rc1.patch.txt

完了したら、カーネルソースをインストーラの引数として提供します。

./nvidia-installer --kernel-source-path /home/tja/linux/linux-3.0-rc2

...そしてよく建てられました!

これで、正しいNvidiaドライバを使用してLinux 3を実行できます。

おすすめ記事