treeman1111 Tux's lil' helper
Joined: 06 Mar 2013 Posts: 77
|
Posted: Tue Jul 29, 2014 2:42 pm Post subject: [solved] gdm 3.12.2 and Nvidia Optimus |
|
|
When I launch gdm (systemctl start gdm), I end up with a black screen. The same happens when I run xinit. This xorg.conf worked well with Xfce4.
Here is my ~/.xinitrc:
Code: |
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
exec gnome-session
|
Here is my /etc/X11/xorg.conf:
Code: |
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration"
EndSection
Section "Device"
Identifier "intel"
Driver "modesetting"
EndSection
Section "Screen"
Identifier "intel"
Device "intel"
EndSection
|
The end of my /var/log/Xorg.0.log
Code: |
[ 18.949] (**) PS/2 Generic Mouse: Applying InputClass "evdev pointer catchall"
[ 18.949] (II) Using input driver 'evdev' for 'PS/2 Generic Mouse'
[ 18.949] (**) PS/2 Generic Mouse: always reports core events
[ 18.950] (**) evdev: PS/2 Generic Mouse: Device: "/dev/input/event6"
[ 18.950] (--) evdev: PS/2 Generic Mouse: Vendor 0x2 Product 0x1
[ 18.950] (--) evdev: PS/2 Generic Mouse: Found 3 mouse buttons
[ 18.950] (--) evdev: PS/2 Generic Mouse: Found relative axes
[ 18.950] (--) evdev: PS/2 Generic Mouse: Found x and y relative axes
[ 18.950] (II) evdev: PS/2 Generic Mouse: Configuring as mouse
[ 18.950] (**) evdev: PS/2 Generic Mouse: YAxisMapping: buttons 4 and 5
[ 18.950] (**) evdev: PS/2 Generic Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 18.950] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio4/input/input13/event6"
[ 18.950] (II) XINPUT: Adding extended input device "PS/2 Generic Mouse" (type: MOUSE, id 13)
[ 18.950] (II) evdev: PS/2 Generic Mouse: initialized for relative axes.
[ 18.950] (**) PS/2 Generic Mouse: (accel) keeping acceleration scheme 1
[ 18.950] (**) PS/2 Generic Mouse: (accel) acceleration profile 0
[ 18.950] (**) PS/2 Generic Mouse: (accel) acceleration factor: 2.000
[ 18.950] (**) PS/2 Generic Mouse: (accel) acceleration threshold: 4
[ 18.950] (II) config/udev: Adding input device PS/2 Generic Mouse (/dev/input/mouse0)
[ 18.950] (II) No input driver specified, ignoring this device.
[ 18.950] (II) This device may have been added with another device file.
[ 18.954] (II) systemd-logind: got pause for 226:1
[ 18.954] (II) systemd-logind: got pause for 226:0
[ 18.967] (II) modesetting(G0): EDID vendor "LGD", prod id 803
[ 18.967] (II) modesetting(G0): Printing DDC gathered Modelines:
[ 18.967] (II) modesetting(G0): Modeline "1920x1080"x0.0 138.00 1920 1952 1988 2088 1080 1085 1090 1102 -hsync -vsync (66.1 kHz eP)
[ 18.968] reporting 7 3 20 149
[ 19.001] have a master to look out for
[ 19.001] adjust shatters 0 1920
[ 19.004] need to create shared pixmap 1(EE) modesetting(G0): failed to set mode: Permission deniedreporting 7 3 20 149
[ 19.334] reporting 7 3 20 149
[ 19.867] reporting 7 3 20 149
[ 19.925] (II) modesetting(G0): EDID vendor "LGD", prod id 803
[ 19.925] (II) modesetting(G0): Printing DDC gathered Modelines:
[ 19.925] (II) modesetting(G0): Modeline "1920x1080"x0.0 138.00 1920 1952 1988 2088 1080 1085 1090 1102 -hsync -vsync (66.1 kHz eP)
[ 19.926] reporting 7 3 20 149
[ 20.134] reporting 7 3 20 149
[ 20.167] reporting 7 3 20 149
[ 20.167] reporting 7 3 20 149
[ 20.948] reporting 7 3 20 149
[ 20.972] reporting 7 3 20 149
[ 21.144] reporting 7 3 20 149
[ 21.159] reporting 7 3 20 149
[ 26.573] (II) systemd-logind: got resume for 226:0
|
How do I notify GDM that I am using optimus? Do I need to edit something in the /etc/gdm/ directory?
Solution:
I was able to resolve this issue by editing my /etc/gdm/Init/Default to contain the necessary xrandr lines:
Code: |
#!/bin/sh
# Stolen from the debian kdm setup, aren't I sneaky
# Plus a lot of fun stuff added
# -George
PATH="/usr/bin:$PATH"
OLD_IFS=$IFS
## THESE ARE THE LINES THAT I ADDED!
exec xrandr --setprovideroutputsource modesetting NVIDIA-0
exec xrandr --auto
gdmwhich () {
COMMAND="$1"
OUTPUT=
IFS=:
for dir in $PATH
do
if test -x "$dir/$COMMAND" ; then
if test "x$OUTPUT" = "x" ; then
OUTPUT="$dir/$COMMAND"
fi
fi
done
IFS=$OLD_IFS
echo "$OUTPUT"
}
sysresources=/etc/X11/Xresources
# merge in defaults
if [ -f "$sysresources" ]; then
xrdb -merge "$sysresources"
fi
sysmodmap=/etc/X11/Xmodmap
XMODMAP=`gdmwhich xmodmap`
if [ "x$XMODMAP" != "x" ] ; then
if [ "x$GDM_PARENT_DISPLAY" = "x" ]; then
if [ -f $sysmodmap ]; then
$XMODMAP $sysmodmap
fi
else
( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $XMODMAP -pke ) | $XMODMAP -
fi
#
# Switch Sun's Alt and Meta mod mappings
#
UNAME=`gdmwhich uname`
PROCESSOR=`$UNAME -p`
if [ "x$PROCESSOR" = "xsparc" ]; then
if $XMODMAP | grep mod4 | grep Alt > /dev/null 2>/dev/null
then
$XMODMAP -e "clear Mod1" \
-e "clear Mod4" \
-e "add Mod1 = Alt_L" \
-e "add Mod1 = Alt_R" \
-e "add Mod4 = Meta_L" \
-e "add Mod4 = Meta_R"
fi
fi
fi
SETXKBMAP=`gdmwhich setxkbmap`
if [ "x$SETXKBMAP" != "x" ] ; then
# FIXME: is this all right? Is this completely on crack?
# What this does is move the xkb configuration from the GDM_PARENT_DISPLAY
# FIXME: This should be done in code. Or there must be an easier way ...
if [ -n "$GDM_PARENT_DISPLAY" ]; then
XKBSETUP=`( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $SETXKBMAP -v )`
if [ -n "$XKBSETUP" ]; then
XKBKEYMAP=`echo "$XKBSETUP" | grep '^keymap' | awk '{ print $2 }'`
XKBTYPES=`echo "$XKBSETUP" | grep '^types' | awk '{ print $2 }'`
XKBCOMPAT=`echo "$XKBSETUP" | grep '^compat' | awk '{ print $2 }'`
XKBSYMBOLS=`echo "$XKBSETUP" | grep '^symbols' | awk '{ print $2 }'`
XKBGEOMETRY=`echo "$XKBSETUP" | grep '^geometry' | awk '{ print $2 }'`
if [ -n "$XKBKEYMAP" ]; then
$SETXKBMAP -keymap "$XKBKEYMAP"
elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" -a -n "$XKBGEOMETRY" ]; then
$SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS" -geometry "$XKBGEOMETRY"
elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then
$SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS"
elif [ -n "$XKBSYMBOLS" ]; then
$SETXKBMAP -symbols "$XKBSYMBOLS"
fi
fi
fi
fi
exit 0
|
|
|