Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
X segfaults with NVidia Optimus
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Rongidge
n00b
n00b


Joined: 19 Dec 2009
Posts: 9

PostPosted: Tue Nov 05, 2013 5:03 pm    Post subject: X segfaults with NVidia Optimus Reply with quote

I've recently bought a new laptop with a NVidia Optimus system and I can get the Intel GMA working just fine.
But, if I try to switch to the NVidia card, the screen stays black at first (as is to be expected, since I'm not using .xinitrc yet).
So I switch to a terminal (CTRL+ALT+F2) and
Code:
user123@KANTE ~ $ DISPLAY=:0 xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x2b5 cap: 0x1, Source Output crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-0
Provider 1: id: 0x46 cap: 0x2, Sink Output crtcs: 3 outputs: 4 associated providers: 0 name:modesetting

So far, so good.
Now I try to switch the provider
Code:
user123@KANTE ~ $ DISPLAY=:0 xrandr --setprovideroutputsource modesetting NVIDIA-0
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 17 requests (17 known processed) with 0 events remaining

and X segfaults.

Sadly, I'm a complete idiot when it comes to segfaults and searching with google didn't provide me with an answer, so I'm rather clueless and hope someone here can help me.

Xorg.0.log: http://pastebin.com/WD0xDTF5
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"
   # Uncomment this line if your computer has no display devices connected to
   # the NVIDIA GPU. Leave it commented if you have display devices
   # connected to the NVIDIA GPU that you would like to use.
   Option "UseDisplayDevice" "none"
   Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
   Identifier "intel"
   Driver "modesetting"
   #BusID "PCI:0:0:2"
EndSection

Section "Screen"
   Identifier "intel"
   Device "intel"
EndSection

Section "InputClass"
   Identifier "keyboard-all"
   Driver "evdev"
   Option "XkbLayout" "at"
   Option "XkbModel" "pc104"
   #Option "XkbOptions" "terminate:ctrl_alt_bksp"
   Option "XkbVariant" "nodeadkeys,"
   #MatchIsKeyboard "on"
EndSection

emerge --info:
Code:
 Portage 2.2.7 (default/linux/amd64/13.0/desktop/gnome, gcc-4.7.3, glibc-2.15-r3, 3.9.11-gentoo-r1 x86_64)
=================================================================
System uname: Linux-3.9.11-gentoo-r1-x86_64-Intel-R-_Core-TM-_i5-4200M_CPU_@_2.50GHz-with-gentoo-2.2
KiB Mem:     3962524 total,   3674064 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of tree: Mon, 04 Nov 2013 19:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.5-r3, 3.2.5-r3
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.12.6, 1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.3-r1, 4.8.1-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo desktop-effects gamerlay ohnobinki_overlay proaudio science sunrise x11 xfce-dev local-repo g-octave
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_AT.utf8@euro"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/desktop-effects /var/lib/layman/gamerlay /var/lib/layman/ohnobinki /var/lib/layman/pro-audio /var/lib/layman/science /var/lib/layman/sunrise /var/lib/layman/x11 /var/lib/layman/xfce-dev /usr/local/portage /var/lib/g-octave"
USE="X a52 aac aalib acl acpi alsa amd64 bash-completion berkdb branding bzip2 cairo cdda cddb cdr cli colord consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss emerald encode evo exif extras fam ffmpeg fftw firefox flac fontconfig fortran gconf gdbm geoip gif gnome gnome-keyring gnome-online-accounts gpm grub gstreamer gtk iconv id3 introspection ipv6 jack java jpeg kate lame laptop lash lcms ldap libnotify libsamplerate libsecret mad matroska mmx mng modules mono mp3 mp4 mpeg mplayer mtp mudflap multilib musepack music nautilus ncurses networkmanager nls nptl offensive ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt3support qt4 radius rdesktop readline samba schroedinger sdl session socialweb spell sse sse2 sse3 sse4 ssl ssse3 startup-notification svg tcpd theora threads tiff truetype udev udisks unicode upower usb uxa v4l vala vdpau video vnc vorbis wavpack wxwidgets x264 xcb xcomposite xinerama xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="modesetting nvidia intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON


If you need additional information, let me know.
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Tue Nov 05, 2013 6:10 pm    Post subject: Reply with quote

See:
eyoung100 wrote:
NeddySeagoon wrote:
The Intel one is a complete graphics system. It can write new images in the pixel buffer and read the pixel buffer out to the dispaly.
The nVidia graphics can only write new images in the pixel buffer. It has no way to get the pixel buffer onto the screen.
This means that for low power/performce you use the Intel system.
For high power/performance you use the Intel system to refresh the screen and the nVidia chip to draw in the pixel buffer.


See this Photo, and this NVIDIA info site.

The Blue Dot = intel.
The RedDot = NVIDIA
Green Dot = Optimus Driver Software
In Low to Average Power, the Blue Dot creates the Pixel Buffer :arrow: Sends the Buffer to the Intel Graphics Bus :arrow: Intel Draws Output on Screen.
In Situations Where Graphics are in High Demand :arrow: Battery Saver Disabled :arrow: NVIDIA Draws the Pixel Buffer :arrow: NVIDIA sends the Buffer to the Intel Graphics Bus :arrow: Intel Draws Output on Screen.

This works because the CPU Power in the NVIDIA GPU does all the Pixel Manipulation , and once rendered only needs intel to output it, therefore the NVIDIA Card has no output buffer, unless both cards work in tandem. That is why the system cannot power on the MDP Port unless the Optimus Driver is installed, because it bridges the Highend Pixel Buffer you Paid for with the Intel Video Chipset that is default in all "pure intel systems" The driver software only worked in Windows until the Bumblebee Project.

In your first Example, the MDP Port is Connected to "all intel parts" and no bridging software is needed. In the Highend Model, the MDP input is wired to the NVIDIA, but since the output buffer doesn't exist, the MDP output is still wired to the Intel. The NVIDIA isn't disabled, it just isn't "turned on" until the Optimus Driver Software is installed. See The Bumblebee Wiki
Quote:
Welcome to our wiki!

Many recent notebooks with a discrete nVidia card in it and an i3/i5/i7 processor use the nVidia Optimus technology to improve battery life. Unfortunately, this software solution is only available in Windows 7 and later.

The Bumblebee Project is a set of tools developed by people aiming to provide Optimus support under Linux (legacy nVidia hybrid graphics is supported too) while waiting for kernel and drivers to support these notebooks.


Software Solution means Windows Only Driver...


See No Device Detected While startx and Mini Display Port on ThinkPad T530
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Rongidge
n00b
n00b


Joined: 19 Dec 2009
Posts: 9

PostPosted: Tue Nov 05, 2013 7:54 pm    Post subject: Reply with quote

Hi eyoung,

Thanks for the fast answer, but I'm not sure which one of the solutions from the other threads would apply here. I followed the instructions from the nvidia-drivers documentation and get stuck when trying to use xrandr.
By renaming xorg.conf (so it uses an empty one) and switching the opengl profile I get direct rendering working via Mesa.
Code:
user123@KANTE ~ $ glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
<two lines with GL capabilities>


Should I expect something like this when everything works? Does it just work out-of-the-box?
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Tue Nov 05, 2013 8:02 pm    Post subject: Reply with quote

Have you installed Bumblebee :?:
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Rongidge
n00b
n00b


Joined: 19 Dec 2009
Posts: 9

PostPosted: Tue Nov 05, 2013 8:30 pm    Post subject: Reply with quote

eyoung100 wrote:
Have you installed Bumblebee :?:

From what I've read in this post it isn't needed anymore.

Edit: To clarify: No, I haven't installed bumblebee because I didn't think it was needed anymore. Could installing it help with detecting the cause of the problem at hand?
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1428

PostPosted: Tue Nov 05, 2013 8:46 pm    Post subject: Reply with quote

I read that post, and his benchmark has bumblebeed running
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Rongidge
n00b
n00b


Joined: 19 Dec 2009
Posts: 9

PostPosted: Tue Nov 05, 2013 8:53 pm    Post subject: Reply with quote

GenBlack wrote:
Nouveau driver and bumblebeed : 1500 fps in 5 seconds (glxgears)
Nvidia driver and bumblebeed : 1500 to 1700 fps in 5 seconds (glxgears)
New driver support the optimus by nvidia : 8000 to 8800 fps in 5 seconds (glxgears)


That last line is where I'd like to end up at, and it doesn't mention bumblebee.
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Wed Nov 06, 2013 8:43 am    Post subject: Reply with quote

Just to clarify, you don't need bumblebee with the binary drivers anymore. I don't know about nouvau.
Back to top
View user's profile Send private message
cyberjun
Apprentice
Apprentice


Joined: 06 Nov 2005
Posts: 293

PostPosted: Mon Feb 10, 2014 12:26 pm    Post subject: Reply with quote

@Rongidge, did you find a solution yet? X segfaults when I try to use optimus without bumblebee. :(

--cyberjun
Back to top
View user's profile Send private message
Rongidge
n00b
n00b


Joined: 19 Dec 2009
Posts: 9

PostPosted: Mon Feb 10, 2014 12:58 pm    Post subject: Reply with quote

The solution for my problem was that --setprovideroutputsource has to be run from the active VT. So you can check if your xorg.conf works first, by running the --listproviders command, but you will have to use .xinitrc if you want to get it running.
The other problem in my case was that the xserver missed the following patch: http://cgit.freedesktop.org/xorg/xserver/commit/?id=bdd1e22cbde9ea2324e4e1991c9e152f22f88151

After patching, recompiling and writing a few lines in .xinitrc I am now able to use my NVidia card behind the Intel GMA. Actual Optimus doesn't work though, but you can't have it all, I guess.
Back to top
View user's profile Send private message
cyberjun
Apprentice
Apprentice


Joined: 06 Nov 2005
Posts: 293

PostPosted: Tue Feb 11, 2014 5:14 am    Post subject: Reply with quote

What do you mean by active VT? I run startx from VT1 and run xrandr from VT2 after setting the DISPLAY variable appropriately. xorg.conf works, since the session starts properly but the display remains black. I can confirm this by running ps. All xfce processes start properly.

However, as soon as I run the xrandr --serprovideroutputsource command, X server segfaults. :(

Also, if I put these commands in .xinitrc, X segfaults immediately after it starts.

Is the patch you are talking about present in xorg-server-1.14.3-r2? I am using nvidia-drivers-331.38.

--cyberjun
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum