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

systemd unit file to fix uvm

Former-commit-id: b82fd0f8
parent cb11cda0
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
/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