nvidia-driver-565/nvidia-graphics-drivers-565/extra_files/nvidia-create-device-nodes

38 lines
865 B
Plaintext
Raw Permalink Normal View History

2024-10-22 17:05:20 +02:00
#! /bin/bash
if ls /dev/ 2>&1 | grep nvidia[0-9] 2>&1 > /dev/null
then
2024-10-22 18:18:23 +02:00
true
2024-10-22 17:05:20 +02:00
else
for gpu in $(cat /proc/driver/nvidia/gpus/*/information | grep Minor | cut -d \ -f 4)
do
echo "Creating device node for NVGPU: ${gpu}"
/usr/bin/nvidia-modprobe -c${gpu}
/usr/bin/nvidia-modprobe -s -c${gpu}
done
fi
if [[ ! -e /dev/nvidia-uvm ]]
then
echo "Creating Unified Memory device nodes"
/usr/bin/nvidia-modprobe -c0 -u
fi
if [[ ! -e /dev/nvidia-nvlink ]]
then
echo "Creating Nvlink device nodes"
2024-10-22 18:18:23 +02:00
/usr/bin/nvidia-modprobe -l
2024-10-22 17:05:20 +02:00
fi
if [[ ! -e /dev/nvidia-modeset ]]
then
echo "Creating modeset device nodes"
2024-10-22 18:18:23 +02:00
/usr/bin/nvidia-modprobe -m
2024-10-22 17:05:20 +02:00
fi
if [[ ! -e /dev/nvidiactl ]]
then
echo "Creating NVIDIA Control device nodes"
nvidia-smi
fi