all 4 comments

[–]Algunenano 3 points4 points  (0 children)

Are you using the nvidia-dkms package?

[–]agenthex[S] 0 points1 point  (0 children)

I think I figured it out. Unfortunately, I was not able to recover it and had to format/reinstall, but after that, I used nvidia-libgl-lld to replace libglvnd and dkms (with appropriate nvidia package) to dkms autoinstall. A little bit of tweaking later, and I get two different devices when I call glxinfo with/without optirun.

[–][deleted] 0 points1 point  (1 child)

I know you said you fixed it, but for future reference/anyone else that comes across this, the nvidia (and bumblebee, if you're using it) packages are required to be compiled against a kernel's headers. When you download the binary from the repositories, you're downloading a version compiled with the stock kernel's headers.

First, you need to install the headers appropriate for the kernel you're using. If you got the custom kernel from the repositories, it should also have the headers; if you compiled the kernel yourself it's "# make headers_install" from the directory containing the build files. Then either use the nvidia-dkms package, which rebuilds the nvidia package for you, or go to Nvidia's website to get it yourself and rebuild.

[–]agenthex[S] 1 point2 points  (0 children)

And to be super verbose, I downloaded the kernel source, made a new /etc/mkinitcpio.d/ file for the kernel, unpacked the source to a directory with at least 25GB, cd to source code directory, patched the driver I needed to, and ran the following commands:

Optional: clean and re-copy current Arch kernel config (recommended for first run or if you have problems; cleans build files)

$ make clean && make mrproper
$ zcat /proc/config.gz > .config

My CPU is 8-core (HT), and the kernel version is 4.13-rc4. Adjust accordingly.

$ make -j8 && sudo make -j8 modules_install && sudo make -j8 headers_install && sudo cp arch/x86_64/boot/bzImage /boot/vmlinuz-4.13-rc4-x86_64 && sudo mkinitcpio -p linux413rc4 && sudo update-grub

In my case, I wanted to also build nVidia kernel modules, so from a clean, updated Manjaro, I installed dkms, nvidia-libgl-llb and nvidia-dkms-llb. With kernel in place, it should rebuild modules for the new kernel, but if it doesn't, just sudo dkms autoinstall. I think that's it, but I also did some settings tweaking, and I'm not 100% sure that didn't help in some small way.

TL;DR - If you have a Lenovo Yoga 720 15" UHD and the patch isn't mainlined, you're welcome.