[Kernel-packages] [Bug 1803179]

2020-07-12 Thread ranjithshegde
New problems in an old thread

After using @Matthias Fulz's method (bumblebee without bbswitch + pm
with powertop+tlp) its quite simple to run any software requiring
nvidia. with his patch.

The problem is in preventing any other software from using nvidia when
not run with optirun/primusrun. For example, any software that calls for
EGL automatically turns on nvidia. Mpv is one of those.

Is there any way to ensure EGL calls intel instead? There is solution in arch 
wiki with env-variable 
"__EGL_VENDOR_LIBRARY_FILENAMES="/usr/share/glvnd/egl_vendor.d/50_mesa.json"
"

but it does not work. I have tried adding it in all possible places
(/etc/environment, /etc/profile, bash-profile, zsh-profile-equivalent
etc..)

-- 
You received this bug notification because you are a member of Kernel
Packages, 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

Status in Linux:
  Incomplete
Status in linux package in Ubuntu:
  Confirmed
Status in nvidia-graphics-drivers-390 package in Ubuntu:
  Confirmed
Status in nvidia-graphics-drivers-410 package in Ubuntu:
  Confirmed

Bug description:
  Dell XPS 15 (9750); it might eventually manage to suspend when the lid
  is closed, but more often than not will not wake up again when the lid
  is opened. Waking up using the power button often results in a system
  that is apparently frozen (graphics displayed are the last on screen
  before suspend, clock seconds do not change)

  System is unresponsive to the keyboard at that time (can't switch to a
  VT or otherwise interact with the system other than holding the power
  button for a few seconds to shut it down).

  ProblemType: Bug
  DistroRelease: Ubuntu 19.04
  Package: linux-image-4.18.0-10-generic 4.18.0-10.11
  ProcVersionSignature: Ubuntu 4.18.0-10.11-generic 4.18.12
  Uname: Linux 4.18.0-10-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.20.10-0ubuntu14
  Architecture: amd64
  AudioDevicesInUse:
   USERPID ACCESS COMMAND
   /dev/snd/controlC0:  mtrudel2516 F pulseaudio
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Nov 13 10:42:08 2018
  InstallationDate: Installed on 2018-11-02 (10 days ago)
  InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 
(20181017.3)
  MachineType: Dell Inc. XPS 15 9570
  ProcFB: 0 inteldrmfb
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-4.18.0-10-generic 
root=UUID=14900847-323c-4427-b59e-89210ec1c8ec ro quiet splash vt.handoff=1
  RelatedPackageVersions:
   linux-restricted-modules-4.18.0-10-generic N/A
   linux-backports-modules-4.18.0-10-generic  N/A
   linux-firmware 1.175
  SourcePackage: linux
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 09/03/2018
  dmi.bios.vendor: Dell Inc.
  dmi.bios.version: 1.5.0
  dmi.board.name: 0D0T05
  dmi.board.vendor: Dell Inc.
  dmi.board.version: A00
  dmi.chassis.type: 10
  dmi.chassis.vendor: Dell Inc.
  dmi.modalias: 
dmi:bvnDellInc.:bvr1.5.0:bd09/03/2018:svnDellInc.:pnXPS159570:pvr:rvnDellInc.:rn0D0T05:rvrA00:cvnDellInc.:ct10:cvr:
  dmi.product.family: XPS
  dmi.product.name: XPS 15 9570
  dmi.product.sku: 087C
  dmi.sys.vendor: Dell Inc.

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

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp


[Kernel-packages] [Bug 1803179]

2020-04-14 Thread ranjithshegde
(In reply to Matthias Fulz from comment #165)
> (In reply to Ranjith Hegde from comment #164)
> > (In reply to Matthias Fulz from comment #161)
> > 
> > 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
> > 
> Ok this is NOT a patch :)
> It's just a simple script to run optirun / primusrun encapsulated to load
> and unload the nvidia module.
> 
> > 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?
> > 
> Yes: I'm quite sure you've got /usr/local/bin in your PATH and this before
> the /usr/bin entry, where optirun / primusrun should be placed in.
> 
> Two possible solutions:
> 
> 1.) Change the lines primusrun $@ and optirun $@ to use the full path a.e.
> /usr/bin/primusrun $@ instead of primusrun $@
> 
> 2.) Rename the scripts to something like /usr/local/bin/primusrun.sh and
> /usr/local/bin/optirun.sh
> 
> Second solution will avoid any naming clushes for sure.
> 
> Hope that helps
> 
> BR,
> Matthias

Thank you for your reply!

Firstly about the naming hickup. I am from computer music background and
any piece of code is referred to as a patch. I know its quite different
in shell scripting or general programming world. my bad

I tried your second solution of using .sh and running it after I close
all programs running on Nvidia. it works. Thanks

If I were to place your script (!) directly inside usr/bin/primusrun
then where would you suggest I put it. here's how it looks, unedited


#!/bin/bash


# Readback-display synchronization method
# 0: no sync, 1: D lags behind one frame, 2: fully synced
# export PRIMUS_SYNC=${PRIMUS_SYNC:-0}

# Verbosity level
# 0: only errors, 1: warnings (default), 2: profiling
# export PRIMUS_VERBOSE=${PRIMUS_VERBOSE:-1}

# Upload/display method
# 0: autodetect, 1: textures, 2: PBO/glDrawPixels (needs Mesa-10.1+)
# export PRIMUS_UPLOAD=${PRIMUS_UPLOAD:-0}

# Approximate sleep ratio in the readback thread, percent
# export PRIMUS_SLEEP=${PRIMUS_SLEEP:-90}

# Secondary display
# export PRIMUS_DISPLAY=${PRIMUS_DISPLAY:-:8}

# "Accelerating" libGL
# $LIB will be interpreted by the dynamic linker
# export PRIMUS_libGLa=${PRIMUS_libGLa:-'/usr/$LIB/nvidia/libGL.so.1'}

# "Displaying" libGL
# export PRIMUS_libGLd=${PRIMUS_libGLd:-'/usr/$LIB/libGL.so.1'}

# Directory containing primus libGL
PRIMUS_libGL=/usr/\$LIB/primus

# On some distributions, e.g. on Ubuntu, libnvidia-tls.so is not available
# in default search paths.  Add its path manually after the primus library
# PRIMUS_libGL=${PRIMUS_libGL}:/usr/lib/nvidia-current:/usr/lib32/nvidia-current

# Mesa drivers need a few symbols to be visible
# export PRIMUS_LOAD_GLOBAL=${PRIMUS_LOAD_GLOBAL:-'libglapi.so.0'}

# Need functions from primus libGL to take precedence
export LD_LIBRARY_PATH=${PRIMUS_libGL}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

# And go!
export __GLVND_DISALLOW_PATCHING=1
exec "$@"

-- 
You received this bug notification because you are a member of Kernel
Packages, 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

Status in Linux:
  Incomplete
Status in linux package in Ubuntu:
  Confirmed
Status in nvidia-graphics-drivers-390 package in Ubuntu:
  Confirmed
Status in nvidia-graphics-drivers-410 package in Ubuntu:
  Confirmed

Bug description:
  Dell XPS 15 (9750); it might eventually manage to suspend when the lid
  is closed, but more often than not will not wake up again when the lid
  is opened. Waking up using the power button often results in a system
  that is apparently frozen (graphics displayed are the last on screen
  before suspend, clock seconds do not change)

  System is unresponsive to the keyboard at that time (can't switch to a
  VT or otherwise interact with the system other than holding the power
  button for a few seconds to shut it down).

  ProblemType: Bug
  DistroRelease: Ubuntu 19.04
  Package: linux-image-4.18.0-10-generic 4.18.0-10.11
  ProcVersionSignature: Ubuntu 4.18.0-10.11-generic 4.18.12
  Uname: Linux 4.18.0-10-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.20.10-0ubuntu14
  Architecture: amd64
  AudioDevicesInUse:
   USERPID ACCESS COMMAND
   /dev/snd/controlC0:  mtrudel2516 F pulseaudio
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Nov 13 10:42:08 2018
  InstallationDate: Installed on 2018-11-02 (10 days ago)
  InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 
(20181017.3)
  MachineType: Dell Inc. XPS 15 9570
  ProcFB: 0 inteldrmfb
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-4.18.0-10-generic 
root=UUID=14900847-323c-4427-b59e-89210ec1c8ec ro quiet splash 

[Kernel-packages] [Bug 1803179]

2020-04-14 Thread ranjithshegde
(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

-- 
You received this bug notification because you are a member of Kernel
Packages, 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

Status in Linux:
  Incomplete
Status in linux package in Ubuntu:
  Confirmed
Status in nvidia-graphics-drivers-390 package in Ubuntu:
  Confirmed
Status in nvidia-graphics-drivers-410 package in Ubuntu:
  Confirmed

Bug description:
  Dell XPS 15 (9750); it might eventually manage to suspend when the lid
  is closed, but more often than not will not wake up again when the lid
  is opened. Waking up using the power button often results in a system
  that is apparently frozen (graphics displayed are the last on screen
  before suspend, clock seconds do not change)

  System is unresponsive to the keyboard at that time (can't switch to a
  VT or otherwise interact with the system other than holding the power
  button for a few seconds to shut it down).

  ProblemType: Bug
  DistroRelease: Ubuntu 19.04
  Package: linux-image-4.18.0-10-generic 4.18.0-10.11
  ProcVersionSignature: Ubuntu 4.18.0-10.11-generic 4.18.12
  Uname: Linux 4.18.0-10-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.20.10-0ubuntu14
  Architecture: amd64
  AudioDevicesInUse:
   USERPID ACCESS COMMAND
   /dev/snd/controlC0:  mtrudel2516 F pulseaudio
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Nov 13 10:42:08 2018
  InstallationDate: Installed on 2018-11-02 (10 days ago)
  InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 
(20181017.3)
  MachineType: Dell Inc. XPS 15 9570
  ProcFB: 0 inteldrmfb
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-4.18.0-10-generic 
root=UUID=14900847-323c-4427-b59e-89210ec1c8ec ro quiet splash vt.handoff=1
  RelatedPackageVersions:
   linux-restricted-modules-4.18.0-10-generic N/A
   linux-backports-modules-4.18.0-10-generic  N/A