Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem installing driver in such a way as to work with bumblebee in fedora #1

Closed
gsgatlin opened this Issue Jan 2, 2016 · 25 comments

Comments

Projects
None yet
8 participants
@gsgatlin
Copy link

gsgatlin commented Jan 2, 2016

Hello and happy new years.

In driver version 352.63 if you call the nvidia installer with these command line arguments it returns successfully: ("0")

./nvidia-installer --accept-license --silent --no-x-check --no-nouveau-check --no-recursion --opengl-libdir=lib64/nvidia-bumblebee --opengl-prefix=/usr --x-library-path=lib64/nvidia-bumblebee --x-prefix=/usr --x-module-path=/usr/lib64/nvidia-bumblebee/xorg/modules --compat32-libdir=lib/nvidia-bumblebee --compat32-prefix=/usr

However, in driver version 358.16 using the same arguments gives:

Building NVIDIA video drivers: Creating directory NVIDIA-Linux-x86_64-358.16
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 358.16........................................................................................................................................................................................................................................................................................

WARNING: The symbolic link '/usr/lib/libGL.so.1' does not point to
'/usr/lib64/nvidia-bumblebee/libGL.so.1' as is necessary for correct
operation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64.
It is possible that ldconfig has created this incorrect symbolic
link because libGL.so.1.2.0's "soname" conflicts with that of
/usr/lib64/nvidia-bumblebee/libGL.so.1. It is recommended that you
remove or rename the file 'libGL.so.1.2.0' and create the necessary
symbolic link by running ln -sf /usr/lib64/nvidia-bumblebee/libGL.so.1 /usr/lib/libGL.so.1.

ERROR: The runtime configuration check failed for the library 'libEGL.so.1'
(expected: '/usr/lib/nvidia-bumblebee/libEGL.so.1', found:
'/lib/libEGL.so.1'). The most likely reason for this is that
conflicting OpenGL libraries are installed in a location not inspected
by nvidia-installer. Please be sure you have uninstalled any
third-party OpenGL and/or third-party graphics driver packages.

ERROR: Installation has failed. Please see the file
'/var/log/nvidia-installer.log' for details. You may find suggestions
on fixing installation problems in the README available on the Linux
driver download page at www.nvidia.com.

It does actually "work" correctly but the wrapper script I created doesn't know it succeeded because the return code from "nvidia-installer" is not "0" in version 358.16. Probably because of some kind of error detection that prints out the all caps ERROR: lines?

Since I run the wrapper at every boot via systemd it just keeps compiling at every boot over and over again since it does not know it succeeded enough for bumblebee to work.

You can test this if you like by checking out the instructions for using bumblebee on fedora here:

https://fedoraproject.org/wiki/Bumblebee

Basically you will want to use the "Unmanaged NVidia repo" and download each blob to test from here:

http://www.nvidia.com/object/unix.html

and then copy it to

/etc/sysconfig/nvidia/

and then run the wrapper script for bumblebee by hand as root:

bumblebee-nvidia --debug

If you want to look over the wrapper its pretty simple. Its just a bash shell script.

Anyways, I made a discussion thread here:

https://devtalk.nvidia.com/default/topic/885657/linux/can-t-install-driver-to-work-with-bumblebee-with-version-355-11/

But probably its better to open a new issue here?

Please let me know if there is any other information you need on this bug?

I was told by samsagax (Joaquín Ignacio Aramendía) back in 2012 that I "needed to figure out how to install NVIDIA binaries in a way that won't break LibGL from mesa in order for the intel card to work properly"

https://lists.launchpad.net/hybrid-graphics-linux/msg02131.html

My solution was to create this wrapper script and to work out for myself the command line arguments needed to the nvidia-installer program...

Thanks so much for taking a look at this and for any ideas you may have. You guys make great graphics chips for these optimus notebooks.

@aaronp24 aaronp24 self-assigned this Jan 4, 2016

@aaronp24

This comment has been minimized.

Copy link
Member

aaronp24 commented Jan 4, 2016

Hi @gsgatlin. I think the best bet is probably to just add a new option to override the runtime configuration check, basically telling nvidia-installer that you realize that you're not installing it as the system GL vendor. I filed NVIDIA bug 1716322 to track this.

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented Jan 4, 2016

Cool. Thanks a lot for your help with this.

@mhirsch

This comment has been minimized.

Copy link

mhirsch commented Jan 21, 2016

Here's a patch that adds the options --no-symlink-check and --no-runtime-check. I tried this successfully with @gsgatlin 's command line, modified like this:

./nvidia-installer --accept-license --silent --no-x-check --no-nouveau-check --no-recursion --opengl-libdir=lib64/nvidia-bumblebee --opengl-prefix=/usr --x-library-path=lib64/nvidia-bumblebee --x-prefix=/usr --x-module-path=/usr/lib64/nvidia-bumblebee/xorg/modules --compat32-libdir=lib/nvidia-bumblebee --compat32-prefix=/usr --no-symlink-check --no-runtime-check

0001-add-no-symlink-check-and-no-runtime-check-to-prevent.patch.zip

@rtzoeller

This comment has been minimized.

Copy link

rtzoeller commented Feb 28, 2016

Is there a timeline for when this fix would be merged?

@mhirsch

This comment has been minimized.

Copy link

mhirsch commented Feb 29, 2016

@aaronp24 I'd love to hear a response on the patch. Isn't that why you put this up on github?

@aaronp24

This comment has been minimized.

Copy link
Member

aaronp24 commented Feb 29, 2016

Sorry for the slow update. We haven't had a chance to evaluate the patch yet.

Longer term, the issue that this request is trying to address should be addressed by the vendor-neutral OpenGL dispatch library: in a Bumblebee configuration, libglvnd will load the NVIDIA GLX implementation automatically for applications connected to the Bumblebee X server, while applications connected to one running Mesa GLX will load the GLX implementation specified by Mesa.

@presianbg

This comment has been minimized.

Copy link

presianbg commented Mar 4, 2016

Hello,

I tried the patches and modded driver provided by math45 from here and it is working fine on Fedora 23.

It is working but there is some other problems, which are described on the following thread.

@presianbg

This comment has been minimized.

Copy link

presianbg commented Mar 16, 2016

any updates ?

@Corsseir

This comment has been minimized.

Copy link

Corsseir commented Mar 25, 2016

Bump, any news? Add that patch to 364 pls.

@mapringg

This comment has been minimized.

Copy link

mapringg commented Apr 27, 2016

Please add the patch to the new driver, so it remains easy to get Nvidia Optimus setup in Fedora.

@MYaman34

This comment has been minimized.

Copy link

MYaman34 commented May 10, 2016

Issue still continue. Please publish the patch.

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented May 17, 2016

I made a new rpm where I try to build nvidia-install with a patch applied based on the pull request above.

But it does not work. So I'm about to give up and just tell people I'm not smart enough to solve this problem. I'm very sorry.

Error message is:

ERROR: Unable to load the 'nvidia-drm' kernel module.

ERROR: Installation has failed. Please see the file
'/var/log/nvidia-installer.log' for details. You may find suggestions
on fixing installation problems in the README available on the Linux
driver download page at www.nvidia.com.

               [FAILED]

Log contents:
https://paste.fedoraproject.org/367749/23581146/

This was with NVIDIA-Linux-x86_64-361.42.run.

Experimental failed packages are at:

http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/experimental/

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented May 17, 2016

Oh, and SELinux being in enforcing / permissive seems to have no effect.

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented May 17, 2016

Sorry, one last detail. Here is the patch I used:

https://paste.fedoraproject.org/367754/63524748/

Could I have missed something?

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented May 18, 2016

Is there a way to git clone the sources that are the same version of nvidia-installer as the version included within NVIDIA-Linux-x86_64-361.42.run ?

@mhirsch

This comment has been minimized.

Copy link

mhirsch commented May 18, 2016

It looks like there's a branch for each driver release.

@mhirsch

This comment has been minimized.

Copy link

mhirsch commented May 18, 2016

I'll take a look at applying my patch to the latest driver build, but I can't do it until the end of next week.

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented May 18, 2016

@mhirsch Thank you. I guess that was what I needed.

So I randomly picked 1e378a8
(361.28) to go with NVIDIA-Linux-x86_64-361.42.run and it actually worked.

But... I will still need help from the fedora community due to the fact that nvidia has added more kernel modules then just nvidia.ko. And I am unsure how to make nvidia_modeset unload. so bbswitch stays on all the time. Which kind of defeats the purpose of optimus.

Also, it looks like the idea of a "unmanaged" package could not work any more unless nvidia merged your pull request. So that sucks for folks who like to use older or newer drivers. But maybe I can make managed version work by cherry picking "nvidia-installer" driver version to compile and use "long lived branch" versions.

I will try to make a rpm that people could experiment with...

@mhirsch Thanks so much for your suggestion.

@mhirsch

This comment has been minimized.

Copy link

mhirsch commented May 18, 2016

I'm still using 361.18, but I have a line like this in /etc/modprobe.d/nvidia-unload.conf

remove nvidia rmmod nvidia-uvm nvidia_modeset nvidia

Any other modules they've added in later driver versions would need to be added to that line. It's not ideal since you get a warning if one of those modules wasn't loaded (e.g. you weren't using CUDA and nvidia-uvm isn't loaded). But it seems like bumblebee removes things properly.

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented May 18, 2016

Doesn't appear to work for me. But thanks a lot for your help.

I created some experimental packages here:

http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/experimental/

I drop a /etc/modprobe.d/nvidia-unload.conf in that rpm with:

[gsgatlin@y470c ~]$ cat /etc/modprobe.d/nvidia-unload.conf
remove nvidia rmmod nvidia-uvm nvidia_modeset nvidia

But they still seem to stay loaded... (After a single use)

[gsgatlin@y470c ~]$ lsmod | grep nvidia
nvidia_modeset 741376 0
nvidia 10072064 1 nvidia_modeset
drm 335872 5 i915,drm_kms_helper,nvidia
[gsgatlin@y470c ~]$ cat /proc/acpi/bbswitch
0000:01:00.0 ON

So maybe something else changed.

@mhirsch

This comment has been minimized.

Copy link

mhirsch commented May 18, 2016

Here's the relevant issue from the bumblebee project: Bumblebee-Project/Bumblebee#565

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented Aug 24, 2016

Since they do not have time to evaluate this fix I have been patching their source code and rebuilding it myself in the rpm. When/if @mhirsch patch stops working I guess we're done and we give up. Any of the ones that were patched are:

361.42 bumblebee-nvidia-361.42-1.fc23.src.rpm
361.45 bumblebee-nvidia-361.45-1.fc23.src.rpm
367.27 bumblebee-nvidia-367.27-1.fc23.src.rpm

and I'm going to try again today with 367.44 to see if it will work since 4.7 kernel will be in fedora 24 very soon.

Here is a link to the patch I am using:

https://paste.fedoraproject.org/413385/50536147/

@mhirsch

This comment has been minimized.

Copy link

mhirsch commented Aug 24, 2016

If it does stop working, let me know -- it wasn't a particularly sophisticated patch. I'd be happy to hack it some more 😁

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented Aug 24, 2016

@mhirsch Ok. Will do. Thank you so much.

@gsgatlin

This comment has been minimized.

Copy link
Author

gsgatlin commented Nov 22, 2016

Hello. This appears to be fixed in version 375.20. But without needing any extra new arguments. Thanks for fixing this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.