Last active
November 28, 2019 05:36
-
-
Save cqbqdd11519/762c581696be7b3f279657416252288e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/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/nvidia-modeset c 195 254 | |
mknod -m 666 /dev/nvidiactl c 195 255 | |
else | |
exit 1 | |
fi | |
/sbin/modprobe nvidia-uvm | |
if [ "$?" -eq 0 ]; then | |
# Find out the major device number used by the nvidia-uvm driver | |
D=`grep nvidia-uvm /proc/devices | awk '{print $1}'` | |
mknod -m 666 /dev/nvidia-uvm c $D 0 | |
mknod -m 666 /dev/nvidia-uvm-tools c $D 1 | |
else | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment