Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # From the nvidia page. Run before using CUDA.
- # I named this nvidiastartup.sh for my main script, but it doesn't really matter.
- /sbin/modprobe nvidia
- if [ "$?" -eq 0 ]; then
- # Count the number of NVIDIA controllers found.
- NVDEVS=`lspci | grep -i NVIDIA`
- N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l`
- NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l`
- N=`expr $N3D + $NVGA - 1`
- for i in `seq 0 $N`; do
- mknod -m 666 /dev/nvidia$i c 195 $i
- done
- mknod -m 666 /dev/nvidiactl c 195 255
- else
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement