Skip to content
Snippets Groups Projects
Commit bb569cef authored by Gin Tan's avatar Gin Tan
Browse files

Merge branch 'uvm' into 'master'

systemd unit file to fix uvm

See merge request !184
parents f054c03b b82fd0f8
No related branches found
No related tags found
1 merge request!184systemd unit file to fix uvm
#!/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
/bin/nvidia-modprobe -u
if [ ! -e /dev/nvidia-uvm ]; then
# Find out the major device number used by the nvidia-uvm driver
D=`grep nvidia-uvm /proc/devices | awk '{print $1}'`
mknod -m 666 /dev/nvidia-uvm c $D 0
else
exit 0
fi
---
- 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: enabled=yes 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