File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 5
5
# output of lshw.
6
6
ENABLE_PM=1
7
7
8
+ # When PM is enabled, remove the card from the system after the command exists
9
+ # and modules unload: the card will be readded in the next nvidia-xrun
10
+ # execution before loading the nvidia module again. This is recommended as Xorg
11
+ # and some other programs tend to load the nvidia module if they detect a
12
+ # nvidia card in the system, and when the module is loaded the card can't save
13
+ # power.
14
+ REMOVE_DEVICE=1
15
+
8
16
# Bus ID of the PCI express controller
9
17
CONTROLLER_BUS_ID=0000:00:01.0
10
18
Original file line number Diff line number Diff line change @@ -19,8 +19,13 @@ function execute {
19
19
}
20
20
21
21
function turn_off_gpu {
22
- echo ' Removing Nvidia bus from the kernel'
23
- execute " sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID} /remove <<<1"
22
+ if [[ " $REMOVE_DEVICE " == ' 1' ]]; then
23
+ echo ' Removing Nvidia bus from the kernel'
24
+ execute " sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID} /remove <<<1"
25
+ else
26
+ echo ' Enabling powersave for the graphic card'
27
+ execute " sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID} /power/control <<<auto"
28
+ fi
24
29
25
30
echo ' Enabling powersave for the PCIe controller'
26
31
execute " sudo tee /sys/bus/pci/devices/${CONTROLLER_BUS_ID} /power/control <<<auto"
You can’t perform that action at this time.
0 commit comments