Skip to content

Instantly share code, notes, and snippets.

@b0noI
Last active October 19, 2018 19:58
Show Gist options
  • Select an option

  • Save b0noI/1dd43053f680f4ab55ec5c44b2142d55 to your computer and use it in GitHub Desktop.

Select an option

Save b0noI/1dd43053f680f4ab55ec5c44b2142d55 to your computer and use it in GitHub Desktop.
#!/bin/bash
git clone https://github.com/b0noI/gcp-gpu-utilization-metrics.git
cd gcp-gpu-utilization-metrics
git checkout 6e62ea324bf097817474b51119786e8222dd9fdf
pip install -r ./requirenments.txt
cp ./report_gpu_metrics.py /root/report_gpu_metrics.py
cat <<-EOH > /lib/systemd/system/gpu_utilization_agent.service
[Unit]
Description=GPU Utilization Metric Agent
[Service]
Type=simple
PIDFile=/run/gpu_agent.pid
ExecStart=/bin/bash --login -c '/usr/bin/python /root/report_gpu_metrics'
User=root
Group=root
WorkingDirectory=/
Restart=always
[Install]
WantedBy=multi-user.target
EOH
systemctl daemon-reload
service start_gpu_agent start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment