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
f666f6aa
Commit
f666f6aa
authored
8 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
updates to the gpu role
parent
3c2d0c72
No related branches found
No related tags found
1 merge request
!54
updates to the gpu role
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 @
f666f6aa
...
@@ -25,74 +25,89 @@
...
@@ -25,74 +25,89 @@
-
xorg-x11-proto-devel
-
xorg-x11-proto-devel
-
xorg-x11-xkb-utils
-
xorg-x11-xkb-utils
-
name
:
Add nouveau from blacklist
-
name
:
install development tools
lineinfile
:
yum
:
name="@Development Tools" state=installed
args
:
become
:
true
dest
:
/etc/modprobe.d/blacklist.conf
become_user
:
root
line
:
"
blacklist
nouveau"
state
:
present
sudo
:
true
-
name
:
Template disable-nouvear.conf
-
name
:
disable nouveau
template
:
dest=/etc/modprobe.d/disable-nouveau.conf src=disable-nouveau.conf.j2
template
:
src=blacklist-nouveau.conf.j2 dest=/etc/modprobe.d/blacklist-nouveau.conf
sudo
:
true
become
:
true
become_user
:
root
-
name
:
Template nvidia.conf
template
:
dest=/etc/modprobe.d/nvidia.conf src=nvidia.conf.j2
sudo
:
true
-
name
:
check nvidia driver
-
name
:
check nvidia driver
shell
:
ls /usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}
shell
:
ls /usr/lib64/libnvidia-opencl.so.{{ nvidia_version }}
register
:
has_been_compi
led
register
:
drivers_instal
led
ignore_errors
:
true
ignore_errors
:
true
-
name
:
Copy boot file
-
name
:
get nvidia driver
template
:
src=grub.conf.j2 dest=/boot/grub/grub.conf
shell
:
wget http://consistency0/src/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
sudo
:
true
args
:
chdir
:
/tmp
creates
:
/tmp/NVIDIA-Linux-x86_64-{{ nvidia_version }}.run
sudo
:
true
when
:
drivers_installed | failed
-
name
:
Copy X config file
#- name: Copy boot file
template
:
src=xorg.conf.j2 dest=/etc/X11/xorg.conf
# template: src=grub.conf.j2 dest=/boot/grub/grub.conf
sudo
:
true
# sudo: true
#
#- name: Copy X config file
# template: src=xorg.conf.j2 dest=/etc/X11/xorg.conf
# sudo: true
-
name
:
Copy xserver file
-
name
:
Copy xserver file
template
:
src=xserver.j2 dest=/etc/pam.d/xserver
template
:
src=xserver.j2 dest=/etc/pam.d/xserver
sudo
:
true
sudo
:
true
-
name
:
look for nouveau
shell
:
/usr/sbin/lsmod
register
:
lsmod_output
-
name
:
set nouveau string
set_fact
:
nouveau='nouveau'
-
name
:
restart_host
-
name
:
restart_host
command
:
shutdown -r now "Reboot triggered by Ansible"
shell
:
sleep 5 ;
shutdown -r now "Reboot triggered by Ansible"
async
:
900
async
:
2
poll
:
60
poll
:
1
sudo
:
true
sudo
:
true
ignore_errors
:
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
-
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
sudo
:
true
when
:
has_been_compi
led | failed
when
:
drivers_instal
led | failed
-
name
:
set persistence mode
-
name
:
restart_host
lineinfile
:
shell
:
sleep 5 ; shutdown -r now "Reboot triggered by Ansible"
args
:
async
:
2
dest
:
/etc/rc.d/rc.local
poll
:
1
line
:
"
nvidia-smi
--persistence-mode=1"
state
:
present
sudo
:
true
sudo
:
true
ignore_errors
:
true
when
:
drivers_installed | failed
-
name
:
Load module
-
name
:
waiting for server to come back
shell
:
modprobe nvidia
local_action
:
wait_for host={{ ansible_host }} state=started port=22 delay=10 search_regex=OpenSSH
sudo
:
true
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 @
3c2d0c72
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