[Fixed] Some problems with PRIME and 361.xx driver or newer

I’m sorry for mistakes: English is not my native language.

I have a notebook CLEVO W150ER with NVIDIA GeForce 650M. I’d bought it when NVIDIA announced the official NVIDIA Optimus technology support for Linux. It was Ubuntu 12.04.3 installed on it’s notebook. To enable NVIDIA PRIME, I’d upgraded it to 12.04.4 and run:

sudo apt-get install --install-recommends linux-generic-lts-sausy xserver-xorg-lts-sausy libgl1-mesa-glx-lts-sausy

I’d enabled ppa:graphics-drivers to get updates for the NVIDIA driver. When NVIDIA 361.xx released, it stopped to work. The operation system starting, but I see blank screen. It seems that xrandr command didn’t work properly.

In NVIDIA 364.xx there was updated requirements to the Linux kernel for NVIDIA PRIME. Now it’s 3.13, but 12.04.4 have 3.11 kernel. I’d upgraded it to 12.04.5 and 3.13. But it still not working.

If I move my HDD to another notebook with NVIDIA GeForce 740M, NVIDIA PRIME is working. So it’s not an operation system bug, it’s in NVIDIA driver. Xrandr doesn’t work properly on 650M but it’s working on 740M

Now I’m using 358.xx driver. I cannot use Vulkan, PRIME Syncrinozation and GLvnd. The last driver version I tried was 396.xx, and it still not working

Also I’d tested many Linux distributions:

openSUSE 12.2 with the kernel 3.16 and X-Server 1.15 (installed from OBS repositories)
Gentoo with 3.16 and 1.13
Gentoo with 4.0 and 1.14

When I tried Ubuntu 15.10 with X-Server 1.18, it works. So I install X-Server 1.18 to my Gentoo. It didn’t works (but works with 740M if I move HDD to my second notebook). I think the problem is an old Linux kernel versions (3.13 - 4.0) and I will try to upgrade it in my Gentoo

Browsing my filesystem, I’d found some xrandr error message saved by me to *.txt file. There is it:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  139 (RANDR)
  Minor opcode of failed request:  35 ()
  Value in failed request:  0x2b2
  Serial number of failed request:  16
  Current serial number in output stream:  17

I didn’t remember is it this case or not

Why are you using an outdated distro? Just use a current one.

No

Hello friends. I’d fixed my problem.

According to this page: http://us.download.nvidia.com/XFree86/Linux-x86_64/430.14/README/randr14.html I add “drm.rnodes=1” parameter to Linux kernel boot string. Now Ubuntu 12.04 can start NVIDIA 361.xx driver or new with PRIME support.

Also I had troubles with some old Linux distributions. My SteamOS install have 4.1 kernel (I didn’t update this system) and driver 355.xx. My tries to upgrade this driver were failed. The solution is adding nvidia-drm kernel module at boot. I create a file in /etc/modprobe.d/*.conf to do this. The reason is that you must to use nvidia-drm module if you’re using PRIME. With 358.x and older drivers, you need not this module (and it wasn’t appear in older drivers). In Gentoo I’d reinstall driver with “drm” USE flag and PRIME is now works on > 361.xx

So, if you see X Error like in my first message (I confirm that it’s appearing in the moment when xrandr cannot enable PRIME), check your modules using lsmod command. Maybe nvidia-drm is not loaded? Also, if your Linux kernel version >= 3.12 and < 3.17, you need to add “drm.rnodes=1” parameter to Linux kernel boot string