Optimus Support for Arch Linux for Dell I7559 Dual Graphics (Intel/Nvidia GTX 960M) Laptop.

So, I have a very interesting laptop that I bought off of Amazon that had a lot of good things that I liked, but I bought this for the GEFORCE GTX 960 that was included for video editing.

Initially, I succeeded in installing the GTX Graphics Card, but there was a lot of screen tearing, so I opted to install bumblebee and disable the discrete card. I don’t have anything in the Bios to switch over, and so I am kind of beside myself.

So, when I encountered some heavy rendering projects, I wanted to switch back, and thought it would be easy. I tried Optimus, prime, bbswitch, etc, and nothing has worked. It is working a little, but the actual graphics card doesn’t switch, but it requires a reboot. Where it shows bbswitch and bumblebee working, but it doesn’t allow me to access my Desktop Manager upon reboot. And this sucks because I have to reinstall Arch Linux when this happens.

I have looked at forums, when on IRC chat, consulted Reddit forums. Nothing, can explain to me why I can have a drop down menu on my panel (I can make the drop down menu if I have the commands)where I choose which GPU I use. I know a little more about NVIDIA right now, and I could set parameters to minimize screen tearing, but I can’t even use it right now.

As far as I am concerned, I think there should be a way to disable the Intel GPU, and enable NVIDIA GPU, and then write a script to disable NVIDIA upon shutdown, reboot, log-out, etc, so that it can reboot into the OS.

The easy way would be to use some Ubuntu-base Distro, it has the necessary infrastructure (alternatives, nvidia-prime, gpumanager) to switch gpus on reboot. Even a panel applet.

Ubuntu doesn’t play nice, but I am thinking of giving Solus a try. I hear that Ikey Doherty is doing a lot of development on optimus. Nvidia-prime works on Arch as well, but it doesn’t render as fast as my intel chip because things like Bumblebee is useless. I would like to see optimus working right since it has been 5 years since we have been getting laptops with these two graphics cards. You would think that someone would give Linux some love by now, but the best we have is with bumblebee, or running it straight with a bunch of screen-tearing.

Current state is:
tearing is fixed with Prime sync, see thread on top of the list.
Switching gpus means the distro has to have the ability to coexist and switch implementations i.e.OpenGL.
I know of Debian and Gentoo and their decendants having this.
Outlook is:
work is being done on ‘server-side glvnd’, Nvidia is involved in that. It’s an extension of the X server that standardises having multiple GL implementations installed in parallel and the X server then switches to that needing to be used. So all distros are gaining the switching ability at no extra cost.

PS: Bumblebee and PRIME are two completely different things, Prime is output redirection while Bumblebee tries to mimic render offload.

I have the same laptop, it currently has issues with nvidia gpu management: https://bugzilla.kernel.org/show_bug.cgi?id=156341

The fix is in the bug report, but I will explain it here. The kernel arg

acpi_osi="!Windows 2015"

is needed for proper power management. I am on Ubuntu 16.04, so I edited my grub config (located at

/etc/default/grub

) to have this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=\"!Windows 2015\""

That should fix your problems on reboot. Then prime / bumblebee will work perfectly. I should probably publish this guide on reddit / other places, but that is for another day.

Generix, could you explain a little further how to set this up? I need a fairly dummy-proof way to set this up, or maybe you know of a link that explains how to set it up easily. I don’t know a lot about altering X-server files, even though, I understand that it is necessary at times. I have used Arch for like 5 years, and have never had to alter the Xserver, and I don’t really want to screw it up too many times.

If you are talking about prime sync: https://ubuntuforums.org/showthread.php?t=2365449

I’m not on Ubuntu. It is too unstable for me. I would use Manjaro or Gentoo maybe, but I won’t use anything Debian based because it is really unstable for me. I don’t like reinstalling my OS more than once every other year or so. I will, however, compare these files to Arch, and see if I can find a workaround. Also, I don’t want to use bumblebee because it slows down my GPU considerably. I would rather just have a separate installation with Nvidia running. I will just have to remember how I did it, and then I will figure out how to eliminate the screentearing.

See this:
https://devtalk.nvidia.com/default/topic/1022670/linux/official-driver-384-59-with-geforce-1050m-doesn-t-work-on-opensuse-tumbleweed-kde/post/5203910/#5203910
Three steps:

  1. have the right xorg.conf
  2. have your DE/DM run the xrandr commands
  3. enable Prime sync (kernel>=4.5, xserver>=1.19)
    The xorg.conf is basically c/p but you might have to change the BusID entries according to yours (use lspci)
    There’s also a link to another user’s script which sets this up for X/GDM/lighdm/Gnome.

…and you should do what pranav_sharma said, that’s really a nasty bug. In any case you should add
acpi_osi="!Windows 2015"

OK, I wasn’t trying to be rude with pranav_sharma, it’s just that I am not really interested in using bumblebee to run my nvidia card, but this is informative. I am going to take a look at this.

OK, I have been fussing with this for two whole days, and I have found the root cause of my problems. There are two, and they are related. Just to give you an idea what I did on a fresh install of arch linux, here’s my script https://pastebin.com/ZWNnxUT0. I get to modprobe nvidia nvidia_modeset nvidia_uvm nvidia_drm and rmmod nvidia-drm && modprobe nvidia-drm.modeset=1 just before systemctl, but it gives me an error (listed on the bottom of my pastebin). This tells me that the Linux Kernel isn’t reading the nvidia device, and when I tried to bypass my DM and startx directly through .xinitrc, I couldn’t get into my system because it wasn’t detecting my laptop screen. I believe that this has been my problem all along.

I haven’t installed bumblebee,primus,bbswitch,etc because I think I need to deal with the root of this problem first, and this just seems to muck up the the issue. Also, I was remembering that when I installed Nvidia last time, that I installed Nvidia-352 which I also tried, but it has since been deprecated in Arch Linux.

Anyway, I am trying to be brief. I can show you my outputs if you think that will help, but I am at a loss for what to do. Is there a missing connection somewhere that I am not getting? Any help is appreciated.

A working ~/.xinitrc for Optimus would be this:

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xterm &
exec xterm

Gives you an X screen with two xterms when using startx.
Besides, run nvidia-bug-report.sh and attach output tar.gz file to your post.

nvidia-drm.modeset=1
is a kernel parameter. Using modprobe, the syntax is
modprobe nvidia-drm modeset=1

Yes, I know this about the .xinitrc file, but the machine doesn’t recognize my hardware or something because I can’t install when doing startx. I’m getting the same error that I can’t modprobe into the nvidia stuff. It doesn’t change anything. The problems are that my laptop doesn’t detect my Nvidia graphics card, and it doesn’t detect my screen nor the nvidia graphics card upon startup which gives me the black frozen screen.

What’s the output of
sudo lspci
Did you disable the nvidia gpu in bios?

I can’t disable any gpu in the BIOS. I appreciate that you tried to help, and there were some things you had right, and others you were way off. So, here it is. I reinstalled to make sure this would work. Not sure if I can restart, shutdown, etc, but that is another issue. Here are the five steps I did in about 5 minutes, and it WORKS!!

  1. nano /etc/default/grub
    nvidia-drm modeset=1
    example: GRUB_CMDLINE_LINUX_DEFAULT=“quiet”
    GRUB_CMDLINE_LINUX=“nvidia-drm modeset=1”
  2. nano /etc/lightdm/display_setup.sh

#!/bin/sh
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

chmod +x /etc/lightdm/display_setup.sh

nano /etc/lightdm/lightdm.conf
	[Seat:*]  uncomment*

display-setup-script=/etc/lightdm/display_setup.sh

sddm:
nano /usr/share/sddm/scripts/Xsetup

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

sudo pacman -S intel-ucode

sudo pacman -S lib32-mesa-demos mesa-demos libva-vdpau-driver nvidia nvidia-libgl lib32-nvidia-utils nvidia-settings lib32-opencl-nvidia

  1. systemctl enable nvidia-persistenced.service
    sudo grub-mkconfig -o /boot/grub/grub.cfg
    mkinitcpio -p linux
    reboot

I don’t know if Arch is better, but it really was easy to do this. Not so easy to figure out.
Thanks!!!

shastenm76, I just followed your instructions and my laptop (Inspiron 7559 with a GTX 960m) is running under Arch Linux, solely on the NVIDIA card like a charm. Thank you!

I installed Arch on this laptop almost 5 months ago and your guide was the only thing I could use to get the NVIDIA card to work as my main GPU.

PS I previously asked how to fix a screen tearing issue but it looks like simply putting nvidia-drm.modeset=1 in GRUB_CMDLINE_LINUX_DEFAULT solved the issue, without the need to follow the other instructions on the arch wiki.

Just wondering if it would be helpful to ask - my Inspiron 7559 is now sporadically freezing up after coming back from sleep. The error message that comes up reads ‘GPU fallen off the bus…’ Any ideas?

It is freezing up because you don’t have fan control. nbfc or i8 are good choices. Just look up fan speed control on the arch wiki to install that. It will fix the freezing issue.