Dual GPU NVIDIA 940m + Intel Sky Lake

I'm running 14.04 on an ASUS UX303UB which features that ever so troublesome dual GPU thingy, with 'Sky Lake Integrated Graphics' for discrete graphics and 'GM108M [GeForce 940M]' for performance graphics.

I've had a very similar laptop, UX303LN, which featured the very same graphics setup but it used a Intel Broadwell architecture where this new one features a Sky Lake architecture.

Having read a bit on the subject, it seems these new architecture wasn't supported before linux 4.3, and was now improved on 4.4.

I'm now running the latest possible kernel (Linux ux303 4.4.4-040404-generic #201603031931 SMP Fri Mar 4 00:34:16 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux), and installed the latest nvidia graphics 352 (tried both the 352 and 352-updates).

But nvidia-prime won't list any of the GPUs, I know I'm stuck on the Intel discrete GPU (because of performance). Running prime-select query simply returns unknown, forcing prime-select nvidia gives me:

   Error: alternatives are not set up properly
   Error: nvidia mode can't be enabled

I am completly stuck on this, have tried a number of different things (so many I can't remember which), I was really hoping the 4.4 kernel would get this to work, but no luck. I was using 3.19 kernel before, and I could see the GPUs on nvidia-prime (just couldn't select the NVIDIA card).

Any help, ideas, comments, or more information you can give, or require, please feel free.


I managed to get it to work following the first part of this link: https://devtalk.nvidia.com/default/topic/936429/-solved-tensorflow-with-gpu-in-anaconda-env-ubuntu-16-04-cuda-7-5-cudnn-/

$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
$ sudo ubuntu-drivers autoinstall
$ sudo reboot

Later:
> Software & Updates > Additional Drivers
Change from nvidia-364 (open source) to "Using NVIDIA - version 361.42 from nvidia-361 (proprietary)

A second issue I had with 16.04 was that suspending/resuming was not working (i.e. Close lid or FnF1 in Asus UX303UB). The only way I found to fix it and at the same time get the nvidia drivers to work was to use Kernel 4.5.4:

$ wget kernel.ubuntu.com/~kernel-ppa/mainline/v4.5.4-yakkety/linux-headers-4.5.4-040504_4.5.4-040504.201605120823_all.deb
$ wget kernel.ubuntu.com/~kernel-ppa/mainline/v4.5.4-yakkety/linux-headers-4.5.4-040504-generic_4.5.4-040504.201605120823_amd64.deb
$ wget kernel.ubuntu.com/~kernel-ppa/mainline/v4.5.4-yakkety/linux-image-4.5.4-040504-generic_4.5.4-040504.201605120823_amd64.deb
$ sudo dpkg -i linux-headers-4.5.4*.deb linux-image-4.5.4*.deb

Be careful with using newer kernels (4.6..) because it seems that NVIDIA drivers dont compile yet: https://www.reddit.com/r/linuxmint/comments/4jqvip/psa_nvidia_drivers_will_not_compile_against/

At least when I tried 4.6, it didnt work in my notebook. Maybe it is a good idea to check again and this will surely change soon.


Had the same problem with asus 303ub. The solution is to disable secure boot in bios(usually under "security tab"), not sure why it works this way and at the first boot after disabling it I got a "black screen" but it went OK after another reboot. For the reference: Asus 303ub, Nvidia 940m, Ubuntu 16.04,

# dpkg -l | grep nvidia
ii  nvidia-361                                 361.42-0ubuntu2                                     amd64        NVIDIA binary driver - version 361.42
ii  nvidia-common                              1:0.4.17.1                                          amd64        transitional package for ubuntu-drivers-common
ii  nvidia-opencl-icd-361                      361.42-0ubuntu2                                     amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                               0.8.2                                               amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                            361.42-0ubuntu1                                     amd64        Tool for configuring the NVIDIA graphics driver
# uname -a
Linux kunlan 4.4.0-22-generic #40-Ubuntu