Comment 182 for bug 1803179

Revision history for this message
In , ranjithshegde (ranjithshegde-linux-kernel-bugs) wrote :

(In reply to Matthias Fulz from comment #161)
> 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.

Hello,
Thank you for your patch and effort. I tried your primusrun patch. First I get an infinite repetitions of this
/bin/bash: warning: shell level (1000) too high, resetting to 1

and when I stop (C-c) I get an infinite loop of this

rmmod: ERROR: Module nvidia is not currently loaded
finished.
unloading nvidia modules ...
rmmod: ERROR: Module nvidia is not currently loaded
finished.

nothing launches..
 Any ideas?

I am on Arch, optimus laptop with intel coffeelake and RTX 2070
I have bumblebeed enabled with your recommended xorg.nvidia settings, using powertop pm to turn off Nvidia card which works fine