File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ Description=Refresh NVIDIA CDI specification file
1717ConditionPathExists =|/usr/bin/nvidia-smi
1818ConditionPathExists =|/usr/sbin/nvidia-smi
1919ConditionPathExists =/usr/bin/nvidia-ctk
20+ # Limit the number of successive restarts to 5 in 10 seconds.
21+ StartLimitBurst =5
22+ StartLimitIntervalSec =10s
2023
2124[Service]
2225Type =oneshot
@@ -26,6 +29,10 @@ EnvironmentFile=-/etc/nvidia-container-toolkit/nvidia-cdi-refresh.env
2629ExecCondition =/usr/bin/grep -qE '/(nvidia|nvidia-current)\\ .ko' /lib/modules/%v/modules.dep
2730ExecStart =/usr/bin/nvidia-ctk cdi generate
2831CapabilityBoundingSet =CAP_SYS_MODULE CAP_SYS_ADMIN CAP_MKNOD
32+ # We set the service to restart on failure to ensure that a CDI spec is
33+ # eventually generated.
34+ Restart =on-failure
35+ RestartSec =1s
2936
3037[Install]
3138WantedBy =multi-user.target
You can’t perform that action at this time.
0 commit comments