2024-04-10, 02:03 AM
I use a GTX 1070
I managed to solve it, in my case, it was happening because the nvidia-uvm module was not starting for some reason.
So I created this script that starts with the system:
I managed to solve it, in my case, it was happening because the nvidia-uvm module was not starting for some reason.
So I created this script that starts with the system:
Code:
DUNAME=/lib/modules/`uname -r`/
DIDKMS=/lib/modules/`uname -r`/updates/dkms/
echo "§§ Checking if nvidia modules are started... §§"
if [[ ! -f "$DUNAME"nvidia-uvm.ko ]]; then
echo "§§ nvidia-uvm.ko does not exist, creating module with symbolic link... §§"
sudo ln -s "$DIDKMS"nvidia-current-uvm.ko "$DUNAME"nvidia-uvm.ko
echo "§§ Updating the module list... §§"
sudo depmod -a
echo "§§ Starting Nvidia modules... §§"
sudo nvidia-container-cli -k -d /dev/tty info
else
echo "§§ nvidia-uvm.ko exists, checking if it is started... §§"
if [[ ! -f /dev/nvidia-uvm ]]; then
echo "§§ nvidia-uvm not started, starting... §§"
sudo nvidia-container-cli -k -d /dev/tty info
else
echo "§§ nvidia-uvm is already started. §§"
fi
fi
## Configure NVIDIA runtime in docker
echo "§§ Configuring Nvidia runtime in docker... §§"
RUNCHK=$(find /etc/docker/daemon.json -exec grep -l -i "nvidia-container-runtime" {} \;)
if [ -z "$RUNCHK" ]; then
sudo nvidia-ctk runtime configure --runtime=docker
echo "§§ Nvidia runtime configured. §§"
echo "§§ Restarting Docker §§"
sudo systemctl restart docker
else
echo "§§ NVIDIA runtime is already configured. §§"
fi