summaryrefslogtreecommitdiffstats
path: root/roles/cuda/templates/cuda_init.sh.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/cuda/templates/cuda_init.sh.j2')
-rw-r--r--roles/cuda/templates/cuda_init.sh.j29
1 files changed, 9 insertions, 0 deletions
diff --git a/roles/cuda/templates/cuda_init.sh.j2 b/roles/cuda/templates/cuda_init.sh.j2
new file mode 100644
index 0000000..3c85ea2
--- /dev/null
+++ b/roles/cuda/templates/cuda_init.sh.j2
@@ -0,0 +1,9 @@
+#!/bin/bash
+# During boot we initialize the GPUs (creates /dev/nvidia*)
+
+if [ ! -f "/usr/bin/nvidia-smi" ]; then
+ logger -s -t nvidia-smi "Script $0 could not find /usr/bin/nvidia-smi"
+else
+ /usr/bin/nvidia-smi --compute-mode={{ cuda_init_compute_mode }}
+ /usr/bin/nvidia-smi --persistence-mode={{ cuda_init_persistence_mode }}
+fi