Announcement

Collapse
No announcement yet.

G750JX hibernate problem, KWin is the culprit

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    G750JX hibernate problem, KWin is the culprit

    Hi! I'm running Kubuntu 14.04 x64 with proprietary Nvidia drivers (currently 337 from xorg-edgers, tried earlier versions from the official (K)ubuntu repository) and occasionally the laptop does not successfully emerge from sleep. Well it does in a way, but the plasma desktop becomes a black screen with a lonely cursor. I can still switch to console and kill the plasma session. I recall some other folks on the internet complaining about this grievance with Nvidia blob on other hardware and distros, so the problem seems to have a wide profile.

    What is most curious, it turned out that it only happens if certain desktop effects are active, like Blur or Fade or maybe something else; other effects like Wobbly Windows and Translucency do not induce this behaviour.

    This is what I tried to no avail:

    + Switching to a different version of Nvidia blob -- all blobs work fine, none help with the problem
    + Playing around with device options in xorg.conf -- all options apply as expected, none help
    + Fiddling with driver-specific environment variables -- everything applies, nothing helps
    + Switching rendering modes in KWin options -- everything applies, nothing helps
    + Switching OpenGL version in KWin options -- everything applies, nothing helps
    + Disabling all PCIE-related powersave options in TLP config -- everything applies, nothing helps
    + Disabling TLP altogether and even uninstalling it -- no luck
    + Enabling Max Performance mode in nvidia settings -- no effect

    I ended up with a custom sleep/wake script that asks any running dbus daemons on a system to tell their session-specific instances of the KWin service to disable compositing then enable it again. The only pre-requisite is that the root user must have sufficient privileges to execute sudo -u without providing a password (you must impersonate since you can't connect to a user's session-local dbus directly as root)

    /usr/lib/pm-utils/sleep.d/101compositing

    Code:
    #!/bin/bash
    
    function disable-compositing ()
    
    {
    
    for f in "$(ps aux | grep -e '--address[=]unix:abstract=/tmp/dbus-')"
    
    do
            OWNER=$(echo $f | cut -d " " -f1)
            BUS=$(echo $f | awk -F '--address[=]unix:abstract=/tmp/dbus-' '{print $2}' | cut -d " " -f1)
    
            sudo -u $OWNER DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-$BUS bash -c \
            'if [ $(qdbus org.kde.kwin /KWin org.kde.KWin.compositingActive) = $0 ]; then qdbus org.kde.kwin /KWin org.kde.KWin.toggleCompositing ; fi' $1
    done
    
    }
    
    case $1 in
    hibernate)
    ;;
    suspend)
    
    disable-compositing true
    
    ;;
    thaw)
    ;;
    resume)
    
    disable-compositing false
    
    ;;
    *)
    ;;
    esac
    I'm wondering if there is a better way of achieving this -- like making all instances of KWin listen on the system dbus and automatically stop compositing when a sleep message is detected, then re-enable compositing after waking? Prodding every instance of dbus (even those without any traces of KDE in their corresponding sessions) as root seems clumsy to me, isn't system dbus what we normally use to make applications aware of system-wide events?

    Maybe it's worth including a similar solution into future releases of Kubuntu? The reasons are:

    1. DIsabling and re-enabling compositing takes a fraction of a second, you can barely notice it, if ever.
    2. You can't predict future changes in proprietary Nvidia drivers. The bug may become more widespread as new Nvidia hardware / drivers emerge. I don't think Nvidia pay any specific attention to KDE and its evolution.
    3. The problem may affect other drivers (like nouveau) and maybe even other hardware (like intel or radeon)

    P.S. My current settings:

    /etc/environment besides other lines contains:

    Code:
    KWIN_DIRECT_GL=1
    __GL_YIELD=USLEEP
    __GL_THREADED_OPTIMIZATIONS=1
    /usr/share/X11/xorg.conf.d/xorg.conf besides other lines contains:

    Code:
    Section "Device"
    
        Identifier     "Device0"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
        Option "TripleBuffer" "True"
        Option "DamageEvents" "1"
        Option "RegistryDwords" "EnableBrightnessControl=1"
    Last edited by eierfrucht; Jun 04, 2014, 01:16 AM.
Working...
X