I'm just using bumblebee and do not blacklist nvidia modules.

This is my /etc/bumblebee/xorg.conf.nvidia

Section "ServerLayout"
    Identifier  "Layout0"
    Option      "AutoAddDevices" "true"
    Option      "AutoAddGPU" "false"
EndSection

Section "Device"
    Identifier  "DiscreteNvidia"
    Driver      "nvidia"
    VendorName  "NVIDIA Corporation"


    Option "NoLogo" "true"
    Option "UseEDID" "false"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "DiscreteNvidia"
EndSection

And I'm just using an additional systemd service for powertop
/etc/systemd/system/powertop.service:

[Unit]
Description=PowerTOP auto tune

[Service]
Type=idle
Environment="TERM=dumb"
ExecStart=/usr/bin/bash -c "sleep 30 && /usr/bin/powertop --auto-tune && sleep 
10 && echo 'on' > '/sys/bus/usb/devices/1-1/power/control'"

[Install]
WantedBy=multi-user.target

Then I've everything ready and can use:
primusrun
optirum

for nvidia GPU stuff. For the unloading of the modules after the use I'm
using the following scripts:

/usr/local/bin/primusrun

#!/bin/bash

trap unload 1 2 3 6

unload() {
    /usr/bin/lsmod | grep nvidia > /dev/null 2>&1
    if [ $? -eq 0 ]
    then
        echo "unloading nvidia modules ..."
        sleep 2
        /usr/bin/lsmod | grep nvidia_modeset > /dev/null 2>&1
        if [ $? -eq 0 ]
        then
            sudo /usr/bin/rmmod nvidia_modeset
        fi
        sudo /usr/bin/rmmod nvidia
        echo "finished."
    fi
}

primusrun $@
unload

/usr/local/bin/optirun

#!/bin/bash

trap unload 1 2 3 6

unload() {
    /usr/bin/lsmod | grep nvidia > /dev/null 2>&1
    if [ $? -eq 0 ]
    then
        echo "unloading nvidia modules ..."
        sleep 2
        /usr/bin/lsmod | grep nvidia_modeset > /dev/null 2>&1
        if [ $? -eq 0 ]
        then
            sudo /usr/bin/rmmod nvidia_modeset
        fi
        sudo /usr/bin/rmmod nvidia
        echo "finished."
    fi
}

optirun $@
unload

That's it for me.

In addition for powersavings I'm using TLP with quite default settings.

Offloading inside the nvidia drivers is just not really helpful afaik :)

Hope that helps.

-- 
You received this bug notification because you are a member of Ubuntu-X,
which is subscribed to nvidia-graphics-drivers-390 in Ubuntu.
https://bugs.launchpad.net/bugs/1803179

Title:
  System does not reliably come out of suspend

To manage notifications about this bug go to:
https://bugs.launchpad.net/linux/+bug/1803179/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-x-swat
Post to     : ubuntu-x-swat@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-x-swat
More help   : https://help.launchpad.net/ListHelp

Reply via email to