Replace nouveau driver with nvidia driver on first run
According to https://nouveau.freedesktop.org/wiki/KernelModeSetting/ it ist possible to unload the noveau and kms drivers an replace them with the nvidia driver. Warning: This causes the console output to freeze until the next reboot (which shouldn't matter much because we want to output via Xorg). The yavdr-xorg role performs the equivalent of those command if the module nouveau is loaded: echo 0 > /sys/class/vtconsole/vtcon1/bind rmmod nouveau rmmod ttm rmmod drm_kms_helper rmmod drm modprobe nvidia systemctl start nvidia-persistenced TODO: is the variable first_run still needed?
This commit is contained in:
parent
9acae05e63
commit
ce24cedf53
1222
Manual.html
1222
Manual.html
File diff suppressed because it is too large
Load Diff
110
Manual.org
110
Manual.org
@ -2688,42 +2688,86 @@ preferred_refreshrates:
|
|||||||
name: x@vt7.service
|
name: x@vt7.service
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
||||||
- name: Workaround for wrong connector names on first run
|
- name: check if a nvidia driver has been installed
|
||||||
block:
|
set_fact:
|
||||||
- name: "wait a little bit before starting x-verbose@vt7.service (needed?)"
|
nvidia_driver_installed: '{{ "nvidia" in lookup("file", "/etc/yavdr/autoinstalled") }}'
|
||||||
wait_for:
|
|
||||||
timeout: 10
|
|
||||||
|
|
||||||
- name: "start x-verbose@.service"
|
- name: unload nouveau driver, replace with nvidia
|
||||||
|
block:
|
||||||
|
- name: unbind vconsole
|
||||||
|
shell: echo 0 > /sys/class/vtconsole/vtcon1/bind
|
||||||
|
|
||||||
|
- name: "wait a little, so noveau isn't used anymore"
|
||||||
|
wait_for:
|
||||||
|
timeout: 1
|
||||||
|
|
||||||
|
# unloading the drivers using the modprobe module does not work for some strange reason...
|
||||||
|
- name: unload kms drivers
|
||||||
|
command: rmmod '{{ item }}'
|
||||||
|
loop:
|
||||||
|
- nouveau
|
||||||
|
- ttm
|
||||||
|
- drm_kms_helper
|
||||||
|
- drm
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: load nvidia driver
|
||||||
|
modprobe:
|
||||||
|
name: "nvidia"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: "wait a little before starting nvidia-persistenced"
|
||||||
|
wait_for:
|
||||||
|
timeout: 1
|
||||||
|
|
||||||
|
- name: start nvidia-persistenced
|
||||||
systemd:
|
systemd:
|
||||||
name: "x-verbose@vt7.service"
|
name: "nvidia-persistenced"
|
||||||
state: started
|
state: started
|
||||||
enabled: false
|
enabled: true
|
||||||
masked: false
|
masked: false
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
when:
|
||||||
|
- nvidia_detected
|
||||||
|
- nvidia_driver_installed
|
||||||
|
- '"nouveau" in modules'
|
||||||
|
|
||||||
- name: "wait a little bit, so X has some time to start up (needed?)"
|
#- name: Workaround for wrong connector names on first run
|
||||||
wait_for:
|
# block:
|
||||||
timeout: 3
|
# - name: "wait a little bit before starting x-verbose@vt7.service (needed?)"
|
||||||
|
# wait_for:
|
||||||
|
# timeout: 10
|
||||||
|
#
|
||||||
|
# - name: "start x-verbose@.service"
|
||||||
|
# systemd:
|
||||||
|
# name: "x-verbose@vt7.service"
|
||||||
|
# state: started
|
||||||
|
# enabled: false
|
||||||
|
# masked: false
|
||||||
|
# daemon_reload: true
|
||||||
|
#
|
||||||
|
# - name: "wait a little bit, so X has some time to start up (needed?)"
|
||||||
|
# wait_for:
|
||||||
|
# timeout: 3
|
||||||
|
#
|
||||||
|
# - name: "stop x-verbose@vt7.service"
|
||||||
|
# systemd:
|
||||||
|
# name: "x-verbose@vt7.service"
|
||||||
|
# state: stopped
|
||||||
|
# enabled: false
|
||||||
|
# masked: true
|
||||||
|
# when: first_run
|
||||||
|
|
||||||
- name: "stop x-verbose@vt7.service"
|
#- name: "wait a little bit, so X has some time to shut down (needed?)"
|
||||||
systemd:
|
# wait_for:
|
||||||
name: "x-verbose@vt7.service"
|
# timeout: 3
|
||||||
state: stopped
|
#
|
||||||
enabled: false
|
#- name: "trigger udevadm reload"
|
||||||
masked: true
|
# command: 'udevadm trigger '
|
||||||
when: first_run
|
#
|
||||||
|
#- name: "wait a little bit, so udev has some time to reapply rules (needed?)"
|
||||||
- name: "wait a little bit, so X has some time to shut down (needed?)"
|
# wait_for:
|
||||||
wait_for:
|
# timeout: 3
|
||||||
timeout: 3
|
|
||||||
|
|
||||||
- name: "trigger udevadm reload"
|
|
||||||
command: 'udevadm trigger '
|
|
||||||
|
|
||||||
- name: "wait a little bit, so udev has some time to reapply rules (needed?)"
|
|
||||||
wait_for:
|
|
||||||
timeout: 3
|
|
||||||
|
|
||||||
- name: "start x-verbose@.service"
|
- name: "start x-verbose@.service"
|
||||||
systemd:
|
systemd:
|
||||||
@ -2733,7 +2777,7 @@ preferred_refreshrates:
|
|||||||
masked: false
|
masked: false
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
|
||||||
- name: "wait a little bit, so X has some time to start up (needed?)"
|
- name: "wait a little, so X has some time to start up"
|
||||||
wait_for:
|
wait_for:
|
||||||
timeout: 3
|
timeout: 3
|
||||||
|
|
||||||
@ -2761,9 +2805,9 @@ preferred_refreshrates:
|
|||||||
enabled: false
|
enabled: false
|
||||||
masked: true
|
masked: true
|
||||||
|
|
||||||
- name: "wait a little bit, so X has some time to shut down (needed?)"
|
#- name: "wait a little bit, so X has some time to shut down (needed?)"
|
||||||
wait_for:
|
# wait_for:
|
||||||
timeout: 3
|
# timeout: 3
|
||||||
|
|
||||||
- name: save results
|
- name: save results
|
||||||
block:
|
block:
|
||||||
|
@ -41,42 +41,86 @@
|
|||||||
name: x@vt7.service
|
name: x@vt7.service
|
||||||
state: stopped
|
state: stopped
|
||||||
|
|
||||||
- name: Workaround for wrong connector names on first run
|
- name: check if a nvidia driver has been installed
|
||||||
block:
|
set_fact:
|
||||||
- name: "wait a little bit before starting x-verbose@vt7.service (needed?)"
|
nvidia_driver_installed: '{{ "nvidia" in lookup("file", "/etc/yavdr/autoinstalled") }}'
|
||||||
wait_for:
|
|
||||||
timeout: 10
|
|
||||||
|
|
||||||
- name: "start x-verbose@.service"
|
- name: unload nouveau driver, replace with nvidia
|
||||||
|
block:
|
||||||
|
- name: unbind vconsole
|
||||||
|
shell: echo 0 > /sys/class/vtconsole/vtcon1/bind
|
||||||
|
|
||||||
|
- name: "wait a little, so noveau isn't used anymore"
|
||||||
|
wait_for:
|
||||||
|
timeout: 1
|
||||||
|
|
||||||
|
# unloading the drivers using the modprobe module does not work for some strange reason...
|
||||||
|
- name: unload kms drivers
|
||||||
|
command: rmmod '{{ item }}'
|
||||||
|
loop:
|
||||||
|
- nouveau
|
||||||
|
- ttm
|
||||||
|
- drm_kms_helper
|
||||||
|
- drm
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: load nvidia driver
|
||||||
|
modprobe:
|
||||||
|
name: "nvidia"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: "wait a little before starting nvidia-persistenced"
|
||||||
|
wait_for:
|
||||||
|
timeout: 1
|
||||||
|
|
||||||
|
- name: start nvidia-persistenced
|
||||||
systemd:
|
systemd:
|
||||||
name: "x-verbose@vt7.service"
|
name: "nvidia-persistenced"
|
||||||
state: started
|
state: started
|
||||||
enabled: false
|
enabled: true
|
||||||
masked: false
|
masked: false
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
when:
|
||||||
|
- nvidia_detected
|
||||||
|
- nvidia_driver_installed
|
||||||
|
- '"nouveau" in modules'
|
||||||
|
|
||||||
- name: "wait a little bit, so X has some time to start up (needed?)"
|
#- name: Workaround for wrong connector names on first run
|
||||||
wait_for:
|
# block:
|
||||||
timeout: 3
|
# - name: "wait a little bit before starting x-verbose@vt7.service (needed?)"
|
||||||
|
# wait_for:
|
||||||
|
# timeout: 10
|
||||||
|
#
|
||||||
|
# - name: "start x-verbose@.service"
|
||||||
|
# systemd:
|
||||||
|
# name: "x-verbose@vt7.service"
|
||||||
|
# state: started
|
||||||
|
# enabled: false
|
||||||
|
# masked: false
|
||||||
|
# daemon_reload: true
|
||||||
|
#
|
||||||
|
# - name: "wait a little bit, so X has some time to start up (needed?)"
|
||||||
|
# wait_for:
|
||||||
|
# timeout: 3
|
||||||
|
#
|
||||||
|
# - name: "stop x-verbose@vt7.service"
|
||||||
|
# systemd:
|
||||||
|
# name: "x-verbose@vt7.service"
|
||||||
|
# state: stopped
|
||||||
|
# enabled: false
|
||||||
|
# masked: true
|
||||||
|
# when: first_run
|
||||||
|
|
||||||
- name: "stop x-verbose@vt7.service"
|
#- name: "wait a little bit, so X has some time to shut down (needed?)"
|
||||||
systemd:
|
# wait_for:
|
||||||
name: "x-verbose@vt7.service"
|
# timeout: 3
|
||||||
state: stopped
|
#
|
||||||
enabled: false
|
#- name: "trigger udevadm reload"
|
||||||
masked: true
|
# command: 'udevadm trigger '
|
||||||
when: first_run
|
#
|
||||||
|
#- name: "wait a little bit, so udev has some time to reapply rules (needed?)"
|
||||||
- name: "wait a little bit, so X has some time to shut down (needed?)"
|
# wait_for:
|
||||||
wait_for:
|
# timeout: 3
|
||||||
timeout: 3
|
|
||||||
|
|
||||||
- name: "trigger udevadm reload"
|
|
||||||
command: 'udevadm trigger '
|
|
||||||
|
|
||||||
- name: "wait a little bit, so udev has some time to reapply rules (needed?)"
|
|
||||||
wait_for:
|
|
||||||
timeout: 3
|
|
||||||
|
|
||||||
- name: "start x-verbose@.service"
|
- name: "start x-verbose@.service"
|
||||||
systemd:
|
systemd:
|
||||||
@ -86,7 +130,7 @@
|
|||||||
masked: false
|
masked: false
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
|
||||||
- name: "wait a little bit, so X has some time to start up (needed?)"
|
- name: "wait a little, so X has some time to start up"
|
||||||
wait_for:
|
wait_for:
|
||||||
timeout: 3
|
timeout: 3
|
||||||
|
|
||||||
@ -114,9 +158,9 @@
|
|||||||
enabled: false
|
enabled: false
|
||||||
masked: true
|
masked: true
|
||||||
|
|
||||||
- name: "wait a little bit, so X has some time to shut down (needed?)"
|
#- name: "wait a little bit, so X has some time to shut down (needed?)"
|
||||||
wait_for:
|
# wait_for:
|
||||||
timeout: 3
|
# timeout: 3
|
||||||
|
|
||||||
- name: save results
|
- name: save results
|
||||||
block:
|
block:
|
||||||
|
Loading…
Reference in New Issue
Block a user