2

Let me state this first, I know that questions related to this have already been asked; but I'm still posting this question because none of the available information could solve the problem.

My laptop is msi gl 62 6qd, i7 6700HQ with intel HD graphics 530 and nvidia GTX 950M. I'm using ubuntu 16.04.2. I had to do the nouveau.modeset=0 stuff to get the display working after first boot and install the proprietary nvidia drivers. The power consumption of the nvidia card is quite high though, compared to the intel card. Also there is screen tearing when scrolling fast or watching videos (like vsync problem). So what I want to do is switch to the intel card.

What I have tried so far:
1. Use the nvidia xserver settings application to switch to intel prime profile. Result: It asks to log out and in for the profile switch. If I do that, I can use the intel card. But if I reboot pc, as soon as I login, everything freezes. And I mean absolutely everything, can't even toggle caps lock or num lock. I have to hard reboot, go to tty session, login there and switch back to nvidia prime profile (using prime-select), do another hard reboot before I can use the laptop properly again.
2. I originally asked this for 16.10 where nvidia drivers weren't updated to nvidia-375 and I added a graphics ppa to try to solve it then. In 16.04.2 they are updated, but same problems remain.
3. I have tried looking to see if there is any way to remove the proprietary drivers and then switch to intel graphics. But it appears that the switching technology (something like prime) is only provided by the proprietary drivers.

And no, there is no way of switching between the cards in my BIOS. Any help with regards to this is appreciated.

Edit: If there is a way to remove any drivers related to nvidia and use intel graphics instead, that is fine too. In Windows, the nvidia settings say that the display is connected to the intel card. I don't understand why then ubuntu chooses the nvidia card by default.

Edit2: As suggested by eyoung100, I have installed bumblebee and configured as follows. I set the correct values for driver, kernal-driver, library paths and PMMethod (I tried both auto and bbswitch) in /etc/bumblebee/bumblebee.conf. The conf file says that changes to this file need a server restart (I'm not sure what they mean by server), so I restarted laptop. Then started sudo bumblebeed --daemon. The state of the card is supposed to be changeable after that using sudo tee /proc/acpi/bbswitch <<<OFF. But its producing error saying device 0000:01:00.0 is in use by driver 'nvidia', refusing OFF. The wiki says that the driver needs to be unloaded if this happens. Now I'm not sure how to do that and whether I actually need to do that OR I have done something wrong before this thats leading to the error.

Edit3: Output of sudo apt-get install xserver-xorg-video-intel as requested:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 xserver-xorg-video-intel : Depends: xserver-xorg-core (>= 2:1.17.99.902)
E: Unable to correct problems, you have held broken packages.  

Edit4: Output of sudo apt-cache madison xserver-xorg-core as requested:

xserver-xorg-core | 2:1.18.4-0ubuntu0.2 | http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
xserver-xorg-core | 2:1.18.3-1ubuntu2 | http://in.archive.ubuntu.com/ubuntu xenial/main amd64 Packages  

Edit5: I have tried to purge and then re-install xserver as per eyoung100's answer. But ubuntu starts using the nvidia card immediately after reboot, (possibly) ignoring the i915.modeset=1 boot parameter. I get to a backlit black screen and then nothing happens. I know that the system isn't completely frozen since I can toggle NumLock; but apart from that nothing can be done. I have to use nouveau.modeset=0 to reach the login screen.

I would like to clear out how I immediately know which graphics card is being used. The power key of the laptop is lighted, it shows one color when using intel and other when using nvidia card.

Mihir Gadgil
  • 303
  • 2
  • 4
  • 18
  • Actually I've had this problem. I did sudo prime-select intel to permanently switch to and use Intel graphics by default. But you're still having problems after switching? – lamino Mar 25 '17 at 03:36
  • yes, it totaly freezes on a black screen on reboot, literally nothing works and I only have the option of hard rebooting into a tty session and switch back to nvidia. – Mihir Gadgil Mar 25 '17 at 03:42
  • Try sudo apt-get install --reinstall xserver-xorg-core=2:1.18.4-0ubuntu0.2 to solve the dependency problem you encountered while installing xserver-xorg-video-intel – lamino Mar 25 '17 at 20:40
  • @lamino see Edit5. xserver-xorg-video-intel and many other packages got re-installed with the re-installation of xserver. – Mihir Gadgil Mar 25 '17 at 21:12
  • Great! Now you should be able to switch to intel safely :) There might be some nvidia modules getting in the way. If so, try blacklisting – lamino Mar 25 '17 at 21:15

1 Answers1

0

Read the Bumblebee Wiki

I suspect that you don't realize you have an Optimus Laptop. Also, read my post here on the Gentoo Forums, and just in case:

What is Optimus?


Update after Reading Comments

The process we are trying to achieve is also noted in this bountied post, and technically described in the Ubuntu Wiki Article on Hybrid Graphics.

Note that I'm taking the approach described in the Wiki article, but we must install the intel driver before we can update grub.

Now we must combine both the bountied question and the Help Wiki, as follows. I suspect you installed the nvidia-drivers package from the Additional Hardware entry before realizing your laptop is a Hybrid. Fixing this will momentarily break your Xorg Server requiring use of a TTY to install packages via apt-get. We need to establish a baseline. From a TTY outside of X:

  1. sudo apt-get purge nvidia*
  2. Completely remove XOrg as documented in How To Re-Install Xorg Xserver Completely In Ubuntu
  3. sudo apt-get purge bumblebee bumblebee-nvidia virtualgl
  4. Set the GRUB_CMDLINE_LINUX_DEFAULT="quiet splash XXX.modeset=1" to i915, as stated in the Hybrid Graphics HelpWiki
  5. reboot <-- After this reboot, XOrg should be working on the intel driver.
  6. Reinstall Bumblebee, as noted in the Wiki from earlier.

At this point, with bumblebee installed, you now need to choose the appropriate NVIDIA Drivers, by adding the PPA:

  1. sudo add-apt-repository ppa:graphics-drivers/ppa
  2. sudo apt-get update
  3. sudo apt-get install nvidia-XXX nvidia-prime, where XXX is at least the long lived branch release. Note that the current stable release will upgrade xorg-server, and break the intel driver as shown by your Error Output. If the long lived release breaks X, remove it and restart, each time installing a lower version, until the XOrg Server no longer breaks
eyoung100
  • 655
  • 3
  • 16
  • I read through it, installed and configured bumblebee as much as I could. The problem is that the nvidia card is forever on when I load ubuntu (with bumblebee installed or not). And now when I try to turn it off using bbswitch it tells me that bbswitch is in use by driver nvidia and so can't turn off. The wiki says I have to unload the driver to get around that. I don't know how to do that. So am I doing something wrong or what? On top of that the ubuntu wiki seems to ignore to mention that bumblebeed daemon needs to be run before anything else.. or is it not needed? – Mihir Gadgil Mar 25 '17 at 07:52
  • I meant to say that bbswitch says device 0000:01:00.0 is in use by driver 'nvidia', refusing OFF – Mihir Gadgil Mar 25 '17 at 08:15
  • From a TTY issue modprobe -rf nvidia, then stop and reststart bumblebd – eyoung100 Mar 25 '17 at 08:18
  • So after modprobe I came back to normal desktop, it stayed blank for a few seconds and then display came back. From a terminal I started bumblebee without daemon option and its second output was [ 4666.924298] [ERROR]Unloading nvidia driver timed out. I tried the whole process without leaving tty with same result. – Mihir Gadgil Mar 25 '17 at 08:36
  • The mid probe command removes the module -rf means remove and force. Now reinstall xf86-video-intel, remove nvidia-driver and restart. Let me know if you get a desktop after reboot. – eyoung100 Mar 25 '17 at 08:46
  • There is no package xf86-video-intel in the repositories. Maybe you meant xserver-xorg-video-intel. Trying to install that package produces unmet dependencies error (unmet dependency: xserver-xorg-core (>= 2:1.17.99.902). Trying to apt-get install -f doesn't do anything. – Mihir Gadgil Mar 25 '17 at 17:46
  • Never use -f with apt. Please update your question with the list of blocks, and I'll update my answer accordingly. I apologize for the wrong package name. Gentoo name vs Ubuntu name.... – eyoung100 Mar 25 '17 at 17:53
  • What do you mean by 'list of blocks?' As far as I know the -f option of apt-get is specifically meant for fixing broken dependencies, so why shouldn't I use it? – Mihir Gadgil Mar 25 '17 at 17:57
  • Add the output that apt-get spit out. the list of broken dependencies, aka the block list. And -f does not mean fix, it means "attempt to fix by --force. You never want to force install a package because, in the attempt it succeeds, your system can become unstable. – eyoung100 Mar 25 '17 at 18:07
  • Neither the bountied post nor the hybrid graphics article help. Reason for both: as mentioned in the original question, the system completely freezes on switching to intel graphics and then rebooting. In addition the answer and article are both from 2015 and might be outdated now. The bountied post also seems to be about a desktop pc and not a laptop (last comment on the only answer). – Mihir Gadgil Mar 25 '17 at 18:37
  • Follow the steps above, and tell me if the system still freezes. Sorry for the delay. The instructions took awhile to write. – eyoung100 Mar 25 '17 at 19:02
  • There is some problem with your 2nd command. Either remove or purge. And the package xserver-xorg is not installed. – Mihir Gadgil Mar 25 '17 at 20:10
  • See new link. The package names changed between versions in the bountied post. I hate when they do that... – eyoung100 Mar 25 '17 at 20:23
  • No luck again. After xserver re-installation, it just (probably) ignores the i915.modeset=1 option and starts using nouveau. I have to edit the parameter at boot time to nouveau.modeset=0 to get a working display, otherwise it just sits on a backlit display. The system doesn't freez, but I can't do anything either. – Mihir Gadgil Mar 25 '17 at 21:02