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
1228
Manual.html
1228
Manual.html
File diff suppressed because it is too large
Load Diff
112
Manual.org
112
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
|
||||||
|
set_fact:
|
||||||
|
nvidia_driver_installed: '{{ "nvidia" in lookup("file", "/etc/yavdr/autoinstalled") }}'
|
||||||
|
|
||||||
|
- name: unload nouveau driver, replace with nvidia
|
||||||
block:
|
block:
|
||||||
- name: "wait a little bit before starting x-verbose@vt7.service (needed?)"
|
- name: unbind vconsole
|
||||||
|
shell: echo 0 > /sys/class/vtconsole/vtcon1/bind
|
||||||
|
|
||||||
|
- name: "wait a little, so noveau isn't used anymore"
|
||||||
wait_for:
|
wait_for:
|
||||||
timeout: 10
|
timeout: 1
|
||||||
|
|
||||||
- name: "start x-verbose@.service"
|
# unloading the drivers using the modprobe module does not work for some strange reason...
|
||||||
systemd:
|
- name: unload kms drivers
|
||||||
name: "x-verbose@vt7.service"
|
command: rmmod '{{ item }}'
|
||||||
state: started
|
loop:
|
||||||
enabled: false
|
- nouveau
|
||||||
masked: false
|
- ttm
|
||||||
daemon_reload: true
|
- drm_kms_helper
|
||||||
|
- drm
|
||||||
- name: "wait a little bit, so X has some time to start up (needed?)"
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: load nvidia driver
|
||||||
|
modprobe:
|
||||||
|
name: "nvidia"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: "wait a little before starting nvidia-persistenced"
|
||||||
wait_for:
|
wait_for:
|
||||||
timeout: 3
|
timeout: 1
|
||||||
|
|
||||||
- name: "stop x-verbose@vt7.service"
|
- name: start nvidia-persistenced
|
||||||
systemd:
|
systemd:
|
||||||
name: "x-verbose@vt7.service"
|
name: "nvidia-persistenced"
|
||||||
state: stopped
|
state: started
|
||||||
enabled: false
|
enabled: true
|
||||||
masked: true
|
masked: false
|
||||||
when: first_run
|
daemon_reload: true
|
||||||
|
when:
|
||||||
|
- nvidia_detected
|
||||||
|
- nvidia_driver_installed
|
||||||
|
- '"nouveau" in modules'
|
||||||
|
|
||||||
- name: "wait a little bit, so X has some time to shut down (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: "trigger udevadm reload"
|
#- name: "wait a little bit, so X has some time to shut down (needed?)"
|
||||||
command: 'udevadm trigger '
|
# wait_for:
|
||||||
|
# timeout: 3
|
||||||
- name: "wait a little bit, so udev has some time to reapply rules (needed?)"
|
#
|
||||||
wait_for:
|
#- name: "trigger udevadm reload"
|
||||||
timeout: 3
|
# 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
|
||||||
|
set_fact:
|
||||||
|
nvidia_driver_installed: '{{ "nvidia" in lookup("file", "/etc/yavdr/autoinstalled") }}'
|
||||||
|
|
||||||
|
- name: unload nouveau driver, replace with nvidia
|
||||||
block:
|
block:
|
||||||
- name: "wait a little bit before starting x-verbose@vt7.service (needed?)"
|
- name: unbind vconsole
|
||||||
|
shell: echo 0 > /sys/class/vtconsole/vtcon1/bind
|
||||||
|
|
||||||
|
- name: "wait a little, so noveau isn't used anymore"
|
||||||
wait_for:
|
wait_for:
|
||||||
timeout: 10
|
timeout: 1
|
||||||
|
|
||||||
- name: "start x-verbose@.service"
|
# unloading the drivers using the modprobe module does not work for some strange reason...
|
||||||
systemd:
|
- name: unload kms drivers
|
||||||
name: "x-verbose@vt7.service"
|
command: rmmod '{{ item }}'
|
||||||
state: started
|
loop:
|
||||||
enabled: false
|
- nouveau
|
||||||
masked: false
|
- ttm
|
||||||
daemon_reload: true
|
- drm_kms_helper
|
||||||
|
- drm
|
||||||
- name: "wait a little bit, so X has some time to start up (needed?)"
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: load nvidia driver
|
||||||
|
modprobe:
|
||||||
|
name: "nvidia"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: "wait a little before starting nvidia-persistenced"
|
||||||
wait_for:
|
wait_for:
|
||||||
timeout: 3
|
timeout: 1
|
||||||
|
|
||||||
- name: "stop x-verbose@vt7.service"
|
- name: start nvidia-persistenced
|
||||||
systemd:
|
systemd:
|
||||||
name: "x-verbose@vt7.service"
|
name: "nvidia-persistenced"
|
||||||
state: stopped
|
state: started
|
||||||
enabled: false
|
enabled: true
|
||||||
masked: true
|
masked: false
|
||||||
when: first_run
|
daemon_reload: true
|
||||||
|
when:
|
||||||
|
- nvidia_detected
|
||||||
|
- nvidia_driver_installed
|
||||||
|
- '"nouveau" in modules'
|
||||||
|
|
||||||
- name: "wait a little bit, so X has some time to shut down (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: "trigger udevadm reload"
|
#- name: "wait a little bit, so X has some time to shut down (needed?)"
|
||||||
command: 'udevadm trigger '
|
# wait_for:
|
||||||
|
# timeout: 3
|
||||||
- name: "wait a little bit, so udev has some time to reapply rules (needed?)"
|
#
|
||||||
wait_for:
|
#- name: "trigger udevadm reload"
|
||||||
timeout: 3
|
# 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