Jump to content
Read the Funtoo Newsletter: Summer 2023 ×
  • 0

Xorg stopped working on Intel HD 4200 + NVidia 740M using Optimus




As mentioned in the title, my X stopped working after upping nvidia drivers + the kernel to the latest. Before that everything was fine


Info needed:

emerge --info -> http://pastebin.com/67tcuyqX

emerge -pv gentoo-sources nvidia-drivers -> http://pastebin.com/DvyvtsiX

cat /etc/X11/xorg.conf -> http://pastebin.com/4mZ2vWVC

The .xinitrc file content :

mlinuxgada@Odin ~ $ cat .xinitrc
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

setxkbmap -layout 'us,bg' -variant ',phonetic' -option 'grp:alt_shift_toggle,grp_led:scroll'
xset -dpms

#exec ck-launch-session startxfce4
#exec ck-launch-session enlightenment_start
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session
#exec ck-launch-session dbus-launch --sh-syntax --exit-with-session awesome
#exec ck-launch-session dbus-launch --sh-syntax --exit-with-session i3
#exec ck-launch-session dbus-launch --sh-syntax --exit-with-session xmonad

The lspci | egrep 'VGA|3D' output:

Odin ~ # lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
07:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)
Odin ~ #

Tried to switch back to 3.16 + the old nvidia-drivers, no result.


When starting X, via startx command I get smth , eg on the tty6 I see that some apps are starting/even no X is visible on the laptop display, but the laptop lcd is black.

Do I need some firmware or smth ?



Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

This is the short version of what I just typed and lost. Try emerge @X11-modules-rebuild. Get all target sets via emerge --list-sets (or --list-set). If that does not work, use the Xorg.log file for hints. There is the DRM invalid arg (but maybe that is in compiled code not your config stuff). There is also the hints from the GPU error about a kernel log(?) and the ReadMe file. Need to update Xorg config file? Hardware issue? If the @X11-modules-rebuild does not work, could be a tough admin problem. Good luck!

Link to comment
Share on other sites

  • 0

Thought of something else. I don't know what you know or don't, do or don't do. Maybe this helps someone. This is what I do to make sure the kernel source code is matched at update/compile time to the kernel I will be running after the update of @world.


Maybe there is an incomplete update in your system because it is in the portage tree. It can take a while for drivers or kernels to get updated to match each other (as far as I know). I have had issues that take two major kernel versions to get magically resolved. A hardware-specific driver does not get the same attention as other things that are more generic and widely used, whether that drive updates first and breaks the kernel code or the kernel is updated and breaks the driver code.


I like to update my @world only after and immediately after I update my kernel sources and compile with no problems. After I update my portage tree (emerge --sync), I put or change a 'version lock' on my kernel before I update and compile kernel source (then @world) with a line in my file /etc/portage/package.mask. (I think that could be a directory sometimes, but not for me at least.) I add something like this:

##Lock the kernel source and update only if will point to
##correct source of running kernel to keep ABI sync with
##emerge of dependent X Windows drivers good.

So how do I know what version is the latest? I check for a kernel update: equery l -p vanilla-sources. (Note equery is part of the package gentoolkit. Also, the portage tree queried by equery must be updated by emerge --sync to ever change.)

XXX me # equery l -p vanilla-sources
 * Searching for vanilla-sources ...
[-P-] [  ] sys-kernel/vanilla-sources-3.2.65:3.2.65
[-P-] [  ] sys-kernel/vanilla-sources-3.4.105:3.4.105
[-P-] [  ] sys-kernel/vanilla-sources-3.10.63:3.10.63
[-P-] [  ] sys-kernel/vanilla-sources-3.12.35:3.12.35
[-P-] [  ] sys-kernel/vanilla-sources-3.14.27:3.14.27
[-P-] [  ] sys-kernel/vanilla-sources-3.17.7:3.17.7
[IP-] [  ] sys-kernel/vanilla-sources-3.18.1:3.18.5
XXX me # eselect kernel list
Available kernel symlink targets:
  [1]   linux-3.16.2-keeping
  [2]   linux-3.18.5-keeping *
XXX me #

Initially, the installed kernel sources will be in a directory like '/usr/src/linux-3.18.5' . I rename the directory with a '-keeping' suffix so my --depclean (-c) will not remove it. (Sometimes adding a trailing slash to a directory name is sometimes necessary to make a few command-line tools happy in certain situations.) I also immediately update the symbolic link /usr/src/linux to point to the newly installed kernel source code BEFORE I update @world and even before I compile a new kernel (with genkernel).


If I have problems with the new kernel and/or @world update, I role back the kernel config line in package.mask AND the symbolic link '/usr/src/linux'. You can use something like 'ln -s <target_dir> linux' but why not use eselect?


After eselect kernel list, eselect kernel set <#> to point to correct kernel source code. If I am pointing to a new kernel source, then I copy my latest .config-the-kernel type file to the new kernel source directory and rarely update it (using the --menuconfig option when I run genkernel). Usually, I only change kernel config settings (after initial setup that takes painful experiment) because of a message when I update using emerge, or as a desperate guess for some admin issue (but wild guessing can do more harm than good).


Then I let genkernel build the kernel files and put them in the boot directory. Eventually, I move oldest kernels (3 files each) from my boot kernel directory to a subdirectory (to delete later). I leave one (or more if some wierd issue) of the least old working kernels for Grub2. I run boot-update to make a new os menu for bootup. I might reboot to the new kernel at this point. Check the kernel you are using with 'uname -a' if you like. After all that, I update @world with the correct kernel source code available for any kernel drivers and any other system software code (I think) to compile based on what's in the kernel source directory (to which I have the symbolic link pointing).


As I wrote in previous comment, I coud next use 'emerge @X11-modules-rebuild' sometimes to get X windows drivers to be in sync (proper Abstract Binary Interface or ABI). Probably that is only useful immediately after compiling a new kernel, but I always like to update the whole @world. Also, per the emerge @world output, I might use emerge @preserved-rebuild. Other emerge sets per emerge --list-sets may be useful at times.


If you can't get things to work after all that with total matching between kernel code and remaining world code (or at least X Window drivers), go to your package.mask config file and limit yourself to the kernel version you did have working (or want to try, portage tree package versions get pruned, but that's why I save kernel code), and reset to kernel source pointer link to the old source (you might have protected by renaming) using eselect kernel set <#>. Then maybe reboot to the old kernel that is still there, right? Then update your @world (with the newer kernel versions appropriately masked per your configuration; older ones will not be used, but you could use '=' rather than '>' for the mask line). Hopefully, you can recover what you had before if you can't get the update to the latest to work.


When I reboot my system, I go to the command line, a bunch of virtual terminals: X Windows is not running. I always start X Windows manually by startx and I can go to the virtual console where it is running and kill it with control-C. I switch around with alt-F# (and cntrl if in X Windows desktop). I think there is a way to boot up as admin with no X Windows using the correct 'runlevel'. I don't know how to do that. I just manually start and stop X Windows. I like the control. Sucks to try and troubleshoot X Windows when it gets stuck by being started automatically on bootup.


I hope that helps.

Link to comment
Share on other sites

  • 0

Nothing from the above suggestions worked - rebuild @x11-modules-rebuid, played with xrandr .. Nvidia is listed as a xrandr provider, after starting X I get blank screen. The resolution is set to 8x8.

Nvm, mark that thread as closed. Maybe the problem is somewhere in the firmware or smth like that.

Thanks all for replies ;-)

Link to comment
Share on other sites

  • 0


Is the driver module showing as loaded in the kernel?  You need to make sure that you're building the module for the new kernel version that you're booting to.

/sbin/lsmod |grep nvidia


Yes, its compiled and loaded:

Odin ~ # lsmod | grep nvidia
nvidia               8314138  0
Odin ~ #
Link to comment
Share on other sites

  • 0

After rebuilding almost everything xorg modules/firmware/server related, I get a blank screen. Xorg is working, just the screen is black


In my .xinitrc I use -> xrandr > /tmp/xrandr to be able to see what screens are seen after X is started. I get:

Screen 0: minimum 8 x 8, current 8 x 8, maximum 16384 x 16384

The latest Xorg.0.log is -> http://pastebin.com/Ufc7xpUf.


Do I need custom EDID ? Also, in the log there are some screens there, except Screen0:

[   777.818] (II) modesetting(G0): Output eDP-1-0 has no monitor section
[   777.819] (II) modesetting(G0): Output VGA-1-0 has no monitor section
[   777.819] (II) modesetting(G0): Output HDMI-1-0 has no monitor section
[   777.819] (II) modesetting(G0): EDID for output eDP-1-0

But xrandr in the .xinitrc file, which logs the output cannot see them. Do I need to define some options, like resolution etc, like in a normal xorg.conf file ?


Link to comment
Share on other sites

  • 0

The problem was alittle complicated - bios upgrade / on lower version kernels I had strange CPU0 offs/, firmware + got it working only on  gentoo-sources-3.17.8-r1 ... On upper versions, eg 3.18+ its not fine, as on 3.16*


Now all fine. Wireless stopped/using same kernel config / but its smth with the firmware I guess.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...