Nvidia社ダウンロード版 GLX ドライバを RedHawkに組み込む方法
インストール手順の簡単な流れを示します。
1. ランレベル3以下で起動
2. 現在インストールされているNVIDIAのCUDA/GLXドライバを削除(ccure-nvidia-cuda,ccur-nvidia-glx)
インストールされていなければ3へ移行
3. カーネルツリーを再構築
cd /usr/src/linux-2.6.36.4RedHawk6.0.2
./ccur-config -n -c
4. ダウンロードしたNVIDIAのドライバーをインストール
5. システムを再起動またはランレベル5を起動
本インストール手順は起動されたカーネルフレーバにのみドライバがインストールされます。
従って、異なるカーネルフレーバ(genericまたはdebug)に対してもドライバーをインストールする際は、上記手順を対象となるカーネルを起動した後に再度実行して下さい。
但し、手順4で「-K」オプションを付けるのを忘れないようにして下さい。
具体的な例を以下に示します。
1.TRACEカーネルにおいてランレベル3で起動
2.既存のCUDA/NVIDIAのドライバーをアンインストール
# rpm -e ccur-nvidia-cuda
# rpm -e ccur-nvidia-glx
3. カーネルツリーの再構築を実行
# cd /usr/src/linux-2.6.36.4RedHawk6.0.2
# ./ccur-config -n -c
4. RedHawk6.02用のNVIDIAドライバーをインストール
# sh NVIDIA-Linux-x86_64-346.35.run
5. システムを再起動し、DEBUGカーネルをランレベル3で起動
6. カーネルツリーの再構築を実行
# cd /usr/src/linux-2.6.36.4RedHawk6.0.2
# ./ccur-config -n -c
7. NVIDIAドライバーをインストール
# sh NVIDIA-Linux-x86_64-346.35.run -K
8. システムを再起動し、DEBUGカーネルをランレベル3で起動
9. カーネルツリーの再構築を実行
# cd /usr/src/linux-2.6.36.4RedHawk6.0.2
# ./ccur-config -n -c
10. NVIDIAドライバーをインストール
# sh NVIDIA-Linux-x86_64-346.35.run -K
11.下記nvidia.confファイルをコピー
# cp nvidia.conf /etc/modprobe.d/
#
# ccur-nvidia-glx RPM - nvidia graphics driver module options and alias
#
alias char-major-195-* nvidia
options nvidia NVreg_EnableMSI=1
options nvidia NVreg_InitializeSystemMemoryAllocations=0
options nvidia NVreg_CheckPCIConfigSpace=0
options nvidia NVreg_EnablePCIeGen3=0
12.下記nvidiaファイルをコピー
# cp nvidia /etc/init.d/nvidia
#!/bin/bash
#
# nvidia
# This shell script opens nVidia graphics devices for the first
# time and leaves them open in the background. This avoids
# the open overhead associated with opening an nvidia device file
# when it is currently not already opened by some other program.
# This script uses low start priority since opening the device
# causes most cards to reset/clear the screen.
#
# chkconfig: 2345 99 20
# description: nVidia device file setup
# pidfile: /var/run/nvidia-devfiles
# Copyright 2008-2013, Concurrent Computer Corporation, and distributed under
# the GNU GPL license version 2. For other license arrangements, contact
# Concurrent Computer Corporation.
# Source function library.
. /etc/init.d/functions
prog=nvidia
proguvm=nvidia-uvm
execname=nvidia-devfiles
execprog=/usr/bin/$execname
pidfile=/var/run/$execname.pid
lockfile=/var/lock/subsys/nvidia
xorg_conf_nvidia=0
xorg_nm=/etc/X11/xorg.conf
xorg_save_nm=/etc/X11/xorg.conf.RedHawk-nvidia
# Set xorg_conf_nvidia to 1 if an nvidia xorg.conf file currently exists.
#
check_xorg_conf()
{
if [ ! -f $xorg_nm ]; then
return
fi
fgrep "Driver" $xorg_nm | grep "nvidia" > /dev/null
if [ $? -eq 0 ]; then
xorg_conf_nvidia=1
fi
}
# Save off and remove the nvidia xorg.conf file if one exists.
# This lets a nouveau (or other) graphics driver function properly.
#
save_nvidia_xorg()
{
if [ $xorg_conf_nvidia -eq 1 ]; then
cp $xorg_nm $xorg_save_nm
rm $xorg_nm
fi
}
# If there is currently no nvidia xorg.conf file present,
# then restore the previously saved xorg.conf file if it is present.
#
restore_nvidia_xorg()
{
if [ $xorg_conf_nvidia -eq 1 ]; then
return
fi
if [ -f $xorg_save_nm ]; then
cp $xorg_save_nm $xorg_nm
rm $xorg_save_nm
fi
}
bye()
{
if [ "$1" -eq 0 ]; then
echo_success
else
echo_failure
fi
echo
exit $1
}
start()
{
echo -n "Starting $prog: "
# First check the xorg.conf configuration.
check_xorg_conf
# Skip systems without nVidia graphics.
/sbin/lspci -v | fgrep -i nvidia | fgrep -iq vga > /dev/null 2>&1
if [ $? -ne 0 ]; then
/sbin/lspci -v | fgrep -i nvidia | \
fgrep -iq "3d controller" > /dev/null 2>&1
if [ $? -ne 0 ]; then
save_nvidia_xorg
bye 0
fi
fi
# The nvidia driver module must load successfully.
/sbin/modprobe $prog >/dev/null 2>&1
case $? in
0) restore_nvidia_xorg
;;
*) save_nvidia_xorg
bye 0
;;
esac
# The /dev entries must exist or be created. However, nothing
# can be done if devfs is present and is mounted over /dev.
mount | grep 'on /dev type devfs' >/dev/null && bye 0
# Take a normal exit here if devfs has suppressed the traditional
# character/block device interface.
[ ! -r /proc/devices ] && exit 0
[ $(wc -l /dev/null) -le 5 ] && bye 0
# Get the 'nvidia' or 'nvidia-frontend' major number.
cat /proc/devices | grep nvidia-frontend > /dev/null 2>&1
if [ $? -eq 0 ]; then
major=$(/bin/awk '$2=="nvidia-frontend" {print $1}' /proc/devices) || bye 1
else
major=$(/bin/awk '$2=="nvidia" {print $1}' /proc/devices) || bye 1
fi
[ -z $major ] && bye 1
# Open each nvidia device file if it hasn't already been opened.
[ ! -d /proc/driver/nvidia/gpus ] && bye 1
max_unit=$(ls -1 /proc/driver/nvidia/gpus | wc -l)
unit=0
while [ $unit -lt $max_unit ]
do
if [ ! -c /dev/$prog$unit ]; then
mknod /dev/$prog$unit c $major $unit
chmod 0666 /dev/$prog$unit
chown root:root /dev/$prog$unit
if [ ! -f $execprog ]; then
exec 3< /dev/$prog$unit
exec 3<&-
fi
else
chmod 0666 /dev/$prog$unit
chown root:root /dev/$prog$unit
fi
unit=$[ ${unit} + 1 ]
done
# Create the control file in case some non-X session
# CUDA application requires it.
if [ ! -c /dev/nvidiactl ]; then
mknod /dev/nvidiactl c $major 255
fi
chown root:root /dev/nvidiactl
chmod 0666 /dev/nvidiactl
# Load the uvm module and create the device file in case
# some non-X session and/or non-root user requires it.
/sbin/modprobe $proguvm >/dev/null 2>&1
case $? in
0) major=$(/bin/awk '$2=="nvidia-uvm" {print $1}' /proc/devices)
if [ ! -z $major ]; then
if [ ! -c /dev/$proguvm ]; then
mknod /dev/$proguvm c $major 0
chmod 0666 /dev/$proguvm
chown root:root /dev/$proguvm
else
chmod 0666 /dev/$proguvm
chown root:root /dev/$proguvm
fi
fi
;;
*) ;;
esac
if [ -x $execprog ]; then
if [ -e $pidfile ]; then
killproc -p $pidfile $execname
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f $pidfile
fi
daemon $execprog
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $lockfile
fi
}
stop() {
echo -n $"Stopping $prog: "
if [ -e $pidfile ]; then
killproc -p $pidfile $execname
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $pidfile && rm -f $lockfile
fi
# Squelch any DMA-API messages during driver unload using the
# debug fs interface.
mounted=1
/bin/df -a | grep /sys/kernel/debug >/dev/null
if [ $? -ne 0 ]; then
/bin/mount -t debugfs none /sys/kernel/debug
mounted=0
fi
if [ -f /sys/kernel/debug/dma-api/num_errors ]; then
num_errors=$(/bin/cat /sys/kernel/debug/dma-api/num_errors)
/bin/echo 0 > /sys/kernel/debug/dma-api/num_errors
fi
/sbin/modprobe -r $proguvm >/dev/null 2>&1
/sbin/modprobe -r $prog >/dev/null 2>&1
if [ -f /sys/kernel/debug/dma-api/num_errors ]; then
/bin/echo $num_errors > /sys/kernel/debug/dma-api/num_errors
fi
if [ $mounted -eq 0 ]; then
/bin/umount /sys/kernel/debug
fi
}
case "$1" in
start)
start
bye 0
;;
stop)
stop
bye 0
;;
reload|restart)
stop
start
bye 0
;;
status)
status -p $pidfile $execprog
exit $?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
bye 1
esac
13.必要であれば、ライブラリファイルのリンクを正しくする
# cd /usr/lib
# rm -f libnvidia-eglcore.so
# ln -s libnvidia-eglcore.so.346.35 libnvidia-eglcore.so
# rm -f libnvidia-glsi.so
# ln -s libnvidia-glsi.so.346.35 libnvidia-glsi.so
# rm -f libnvidia-opencl.so.1
# ln -s libnvidia-opencl.so.346.35 libnvidia-opencl.so.1
# rm -f *.RPMSAVE
# cd /usr/lib64
# rm -f libnvidia-opencl.so libnvidia-opencl.so.1
# ln -s libnvidia-opencl.so.346.35 libnvidia-opencl.so.1
# ln -s libnvidia-opencl.so.1 libnvidia-opencl.so
# rm -f libnvidia-fbc.so.1
# ln -s libnvidia-fbc.so.346.35 libnvidia-fbc.so.1
# rm -f *.RPMSAVE
14. X-Windowが正常に起動することを確認
init 5
15. CUDAパッケージをインストールする。
Back