Skip to content
Snippets Groups Projects
Commit b0163ef9 authored by Jafar Lie's avatar Jafar Lie
Browse files

systemd script to make sure /dev/nvidia-* is created

Former-commit-id: a8e46cef
parent c378ac7c
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
echo "Checking nvidia devices"
if [ -f /dev/nvidia-uvm ]; then
echo "Device created"
else
echo "Device not created"
fi
[Unit]
Description=Check Nvidia UVM devices
After=lustre-client.service
Wants=lustre-client.service
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/create-dev-uvm.sh
RemainAfterExit=true
ExecStop=/usr/local/sbin/check-dev-uvm.sh
StandardOutput=journal
[Install]
WantedBy=multi-user.target
#!/bin/bash
# This script is intended to be run via systemd during startup of visnodes to create NVidia UVM Devices
LDFLAGS="-L/usr/local/cuda/8.0.61/lib64/stubs -L/usr/lib64 -L/usr/local/cuda/8.0.61/lib64 -L/usr/local/cuda/8.0.61/lib" /usr/local/cuda/8.0.61/samples/1_Utilities/deviceQuery/deviceQuery
---
- name: Copy Files
become: true
become_user: root
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
mode: 755
with_items:
- { src: 'create-dev-uvm.sh', dest: '/usr/local/sbin/' }
- { src: 'check-dev-uvm.sh', dest: '/usr/local/sbin/' }
- { src: 'create-dev-uvm.service', dest: '/etc/systemd/system/' }
- name: Enable Service
become: true
become_user: root
systemd: state=started name=create-dev-uvm
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment