Skip to content

Commit

Permalink
Merge pull request #32 from AaltoSciComp/nvidia-performance-counters
Browse files Browse the repository at this point in the history
Add functionality for enabling nvidia performance counters
  • Loading branch information
mhakala authored Sep 18, 2020
2 parents bd84791 + bba5000 commit 00da97a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ cuda_bash_cuda_root: "/usr/local/cuda"
cuda_bash_cuda_inc_dir: "/usr/local/cuda/bin"
cuda_bash_cpath: "/usr/local/cuda/include"

cuda_enable_perf_counters: False

# vim:ft=ansible:
7 changes: 7 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
- include_tasks: cuda_init.yml
when: cuda_init

- name: Enable performance counters for all users via modprobe
template:
src: nvidia.conf.j2
dest: /etc/modprobe.d/nvidia.conf
mode: 0644
when: cuda_enable_perf_counters

# This is here because if we in the same playbook try to start slurmd without
# having run the cuda_init.sh script then slurmd doesn't start and the play fails.
# todo: reload nvidia modules/etc instead of restart
Expand Down
1 change: 1 addition & 0 deletions templates/nvidia.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
options nvidia "NVreg_RestrictProfilingToAdminUsers=0"

0 comments on commit 00da97a

Please sign in to comment.