Skip to content

Commit

Permalink
Add option to use nvidia-legacy drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
seahawk1986 committed Apr 26, 2024
1 parent 133fa25 commit 506de44
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 2 deletions.
33 changes: 31 additions & 2 deletions Manual.org
Expand Up @@ -419,6 +419,9 @@ repositories:
- '{{ ppa_owner }}/{{branch}}-vdr'
- '{{ ppa_owner }}/{{branch}}-kodi'

# set to True to add the repository ppa:/kelebek333/nvidia-legacy for nvidia-legacy drivers (340, 390) and disable the ABI version check by the X-Server to use those old drivers
nvidia_legacy: False

#+END_SRC
** Locales and Timezone
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes :padline no
Expand Down Expand Up @@ -794,6 +797,7 @@ You can set a list of package repositories which provide the necessary packages.
#+BEGIN_SRC yaml :tangle roles/yavdr-common/defaults/main.yml :mkdirp yes :padline yes
branch: experimental
ppa_owner: 'ppa:yavdr'
nvidia_legacy: False

# add the following PPAs
repositories:
Expand Down Expand Up @@ -999,6 +1003,13 @@ yavdr-common executes the following tasks:
- ppa
when: ansible_architecture == 'armv7l'

- name: add nvidia legacy PPA
apt_repository:
repo: 'ppa:kelebek333/nvidia-legacy'
state: present
update_cache: no
when: nvidia_legacy

- name: run apt-get dist-upgrade
apt:
upgrade: dist
Expand Down Expand Up @@ -4993,9 +5004,15 @@ EndSection
***** xorg.conf

#+CAPTION: roles/yavdr-xorg/templates/xorg-verbose.conf.j2
#+BEGIN_SRC conf :tangle roles/yavdr-xorg/templates/xorg-verbose.conf.j2
#+BEGIN_SRC jinja2 :tangle roles/yavdr-xorg/templates/xorg-verbose.conf.j2
{{ ansible_managed | comment }}

{% if nvidia_legacy | default(False) %}
Section "ServerFlags"
Option "IgnoreABI" "true"
EndSection
{% endif %}

Section "Device"
Identifier "nvidia"
Driver "nvidia"
Expand All @@ -5010,7 +5027,7 @@ EndSection
#+END_SRC

#+CAPTION: roles/yavdr-xorg/templates/xorg.conf.j2
#+BEGIN_SRC conf :tangle roles/yavdr-xorg/templates/xorg.conf.j2
#+BEGIN_SRC jinja2 :tangle roles/yavdr-xorg/templates/xorg.conf.j2
{{ ansible_managed | comment }}

Section "ServerLayout"
Expand All @@ -5024,6 +5041,12 @@ Section "ServerLayout"
Option "Xinerama" "0"
EndSection

{% if nvidia_legacy | default(False) %}
Section "ServerFlags"
Option "IgnoreABI" "true"
EndSection
{% endif %}

Section "InputClass"
Identifier "exclude eventlircd devices"
MatchTag "eventlircd"
Expand Down Expand Up @@ -5136,6 +5159,12 @@ Section "ServerLayout"
InputDevice "Mouse0" "CorePointer"
EndSection

{ % if nvidia_legacy | default(False) % }
Section "ServerFlags"
Options "IgnoreABI" "true"
EndSection
{ % endif % }

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Expand Down
3 changes: 3 additions & 0 deletions group_vars/all
Expand Up @@ -12,6 +12,9 @@ repositories:
- '{{ ppa_owner }}/{{branch}}-main'
- '{{ ppa_owner }}/{{branch}}-vdr'
- '{{ ppa_owner }}/{{branch}}-kodi'

# set to True to add the repository ppa:/kelebek333/nvidia-legacy for nvidia-legacy drivers (340, 390) and disable the ABI version check by the X-Server to use those old drivers
nvidia_legacy: False
timezone: 'Europe/Berlin'
# timezone_hw can be set to 'UTC' or 'local' to set the preferred hardware clock
# timezone. This variable is optional, the default behavior is to let systemd
Expand Down
1 change: 1 addition & 0 deletions roles/yavdr-common/defaults/main.yml
Expand Up @@ -3,6 +3,7 @@

branch: experimental
ppa_owner: 'ppa:yavdr'
nvidia_legacy: False

# add the following PPAs
repositories:
Expand Down
7 changes: 7 additions & 0 deletions roles/yavdr-common/tasks/configure_apt.yml
Expand Up @@ -24,6 +24,13 @@
- ppa
when: ansible_architecture == 'armv7l'

- name: add nvidia legacy PPA
apt_repository:
repo: 'ppa:kelebek333/nvidia-legacy'
state: present
update_cache: no
when: nvidia_legacy

- name: run apt-get dist-upgrade
apt:
upgrade: dist
Expand Down
6 changes: 6 additions & 0 deletions roles/yavdr-xorg/templates/xorg-verbose.conf.j2
@@ -1,5 +1,11 @@
{{ ansible_managed | comment }}

{% if nvidia_legacy | default(False) %}
Section "ServerFlags"
Option "IgnoreABI" "true"
EndSection
{% endif %}

Section "Device"
Identifier "nvidia"
Driver "nvidia"
Expand Down
6 changes: 6 additions & 0 deletions roles/yavdr-xorg/templates/xorg.conf.j2
Expand Up @@ -11,6 +11,12 @@ Section "ServerLayout"
Option "Xinerama" "0"
EndSection

{% if nvidia_legacy | default(False) %}
Section "ServerFlags"
Option "IgnoreABI" "true"
EndSection
{% endif %}

Section "InputClass"
Identifier "exclude eventlircd devices"
MatchTag "eventlircd"
Expand Down

0 comments on commit 506de44

Please sign in to comment.