Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Commits
ea29138f
Commit
ea29138f
authored
8 years ago
by
Chris Hines
Browse files
Options
Downloads
Plain Diff
Merge branch 'update_gpu' into 'master'
updates to the gpu role See merge request
!54
parents
5459641a
f666f6aa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/gpu/tasks/main.yml
+64
-49
64 additions, 49 deletions
roles/gpu/tasks/main.yml
roles/gpu/templates/disable-nouveau.conf.j2
+0
-3
0 additions, 3 deletions
roles/gpu/templates/disable-nouveau.conf.j2
with
64 additions
and
52 deletions
roles/gpu/tasks/main.yml
+
64
−
49
View file @
ea29138f
...
...
@@ -25,74 +25,89 @@
-
xorg-x11-proto-devel
-
xorg-x11-xkb-utils
-
name
:
Add nouveau from blacklist
lineinfile
:
args
:
dest
:
/etc/modprobe.d/blacklist.conf
line
:
"
blacklist
nouveau"
state
:
present
sudo
:
true
-
name
:
install development tools
yum
:
name="@Development Tools" state=installed
become
:
true
become_user
:
root
-
name
:
Template disable-nouvear.conf
template
:
dest=/etc/modprobe.d/disable-nouveau.conf src=disable-nouveau.conf.j2
sudo
:
true
-
name
:
Template nvidia.conf
template
:
dest=/etc/modprobe.d/nvidia.conf src=nvidia.conf.j2
sudo
:
true
-
name
:
disable nouveau
template
:
src=blacklist-nouveau.conf.j2 dest=/etc/modprobe.d/blacklist-nouveau.conf
become
:
true
become_user
:
root
-
name
:
check nvidia driver
shell
:
ls /usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}
register
:
has_been_compi
led
register
:
drivers_instal
led
ignore_errors
:
true
-
name
:
Copy boot file
template
:
src=grub.conf.j2 dest=/boot/grub/grub.conf
sudo
:
true
-
name
:
get nvidia driver
shell
:
wget http://consistency0/src/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
args
:
chdir
:
/tmp
creates
:
/tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
sudo
:
true
when
:
drivers_installed | failed
-
name
:
Copy X config file
template
:
src=xorg.conf.j2 dest=/etc/X11/xorg.conf
sudo
:
true
#- name: Copy boot file
# template: src=grub.conf.j2 dest=/boot/grub/grub.conf
# sudo: true
#
#- name: Copy X config file
# template: src=xorg.conf.j2 dest=/etc/X11/xorg.conf
# sudo: true
-
name
:
Copy xserver file
template
:
src=xserver.j2 dest=/etc/pam.d/xserver
sudo
:
true
-
name
:
look for nouveau
shell
:
/usr/sbin/lsmod
register
:
lsmod_output
-
name
:
set nouveau string
set_fact
:
nouveau='nouveau'
-
name
:
restart_host
command
:
shutdown -r now "Reboot triggered by Ansible"
async
:
900
poll
:
60
shell
:
sleep 5 ;
shutdown -r now "Reboot triggered by Ansible"
async
:
2
poll
:
1
sudo
:
true
ignore_errors
:
true
when
:
has_been_compiled | failed
when
:
nouveau in lsmod_output.stdout
-
name
:
waiting for server to come back
local_action
:
wait_for host={{ ansible_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo
:
false
when
:
nouveau in lsmod_output.stdout
-
name
:
wait_restart
local_action
:
wait_for host="{{ inventory_hostname }}" port=22 delay=5 timeout=600
sudo
:
true
when
:
has_been_compiled | failed
-
name
:
get nvidia driver
shell
:
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/{{ nvidia_version }}/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
args
:
chdir
:
/tmp
creates
:
/tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
sudo
:
true
when
:
has_been_compiled | failed
-
name
:
build nvidia driver
shell
:
chmod 755 /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run; /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run --silent
--kernel-source-path /usr/src/kernels/{{ kernel_version }}.el6.x86_64
shell
:
chmod 755 /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run; /tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run --silent
sudo
:
true
when
:
has_been_compi
led | failed
when
:
drivers_instal
led | failed
-
name
:
set persistence mode
lineinfile
:
args
:
dest
:
/etc/rc.d/rc.local
line
:
"
nvidia-smi
--persistence-mode=1"
state
:
present
-
name
:
restart_host
shell
:
sleep 5 ; shutdown -r now "Reboot triggered by Ansible"
async
:
2
poll
:
1
sudo
:
true
ignore_errors
:
true
when
:
drivers_installed | failed
-
name
:
Load module
shell
:
modprobe nvidia
sudo
:
true
-
name
:
waiting for server to come back
local_action
:
wait_for host={{ ansible_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo
:
false
when
:
drivers_installed|failed
#- name: set persistence mode
# lineinfile:
# args:
# dest: /etc/rc.d/rc.local
# line: "nvidia-smi --persistence-mode=1"
# state: present
# sudo: true
#- name: Load module
# shell: modprobe nvidia
# sudo: true
This diff is collapsed.
Click to expand it.
roles/gpu/templates/disable-nouveau.conf.j2
deleted
100644 → 0
+
0
−
3
View file @
5459641a
blacklist nouveau
options nouveau modeset=0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment