From e2cddff4c4ff3e72d048965d373083465615e885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 9 Jan 2022 19:36:33 +0100 Subject: [PATCH] Adaptation to using PRIME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For reasons nvidia-xrun doesn't work anymore. There was an update breaking a lot of things apparently, but downgrading didn't help so 🤷‍♂️. Didn't add all the X11 config because might be temporary though. --- .../host_vars/curacao.geoffrey.frogeye.fr | 9 +- .../system/files/xorg/intel_backlight.conf | 2 +- config/scripts/nv | 83 +++++++++++++++++++ 3 files changed, 90 insertions(+), 4 deletions(-) create mode 100755 config/scripts/nv diff --git a/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr b/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr index 4b2fadf..36cbfec 100644 --- a/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr +++ b/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr @@ -15,10 +15,13 @@ extensions: - g - gh x11_screens: -# nvidia +# nvidia-xrun # - HDMI-0 # - eDP-1-1 -# nouveau - - HDMI-1-3 +# mesa + nouveau + # - HDMI-1-3 + # - eDP1 +# mesa + nvidia + - HDMI-1-0 - eDP1 max_video_height: 1440 diff --git a/config/automatrop/roles/system/files/xorg/intel_backlight.conf b/config/automatrop/roles/system/files/xorg/intel_backlight.conf index fa7796b..6b68693 100644 --- a/config/automatrop/roles/system/files/xorg/intel_backlight.conf +++ b/config/automatrop/roles/system/files/xorg/intel_backlight.conf @@ -1,5 +1,5 @@ Section "Device" - Identifier "Intel Graphics" + Identifier "intel" Driver "intel" Option "Backlight" "intel_backlight" EndSection diff --git a/config/scripts/nv b/config/scripts/nv new file mode 100755 index 0000000..e576154 --- /dev/null +++ b/config/scripts/nv @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + +# Extracted frm nvidia-xrun +DRY_RUN=0 + +function execute { + if [[ ${DRY_RUN} -eq 1 ]] + then + echo ">>Dry run. Command: $*" + else + eval $* + fi +} + + +function turn_off_gpu { + if [[ "$REMOVE_DEVICE" == '1' ]]; then + echo 'Removing Nvidia bus from the kernel' + execute "sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID}/remove <<<1" + else + echo 'Enabling powersave for the graphic card' + execute "sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID}/power/control <<