Advertisement
Guest User

Untitled

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