Bug 194924 - x11/nvidia-driver 340.46 fails to install due to conflict with /usr/local/lib/libEGL.so
Summary: x11/nvidia-driver 340.46 fails to install due to conflict with /usr/local/lib...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Many People
Assignee: Alexey Dokuchaev
URL:
Keywords:
: 194886 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-10 12:23 UTC by Gerard Seibert
Modified: 2014-11-27 13:16 UTC (History)
7 users (show)

See Also:
gerard_seibert: maintainer-feedback+


Attachments
Build Log (15.56 KB, text/plain)
2014-11-10 12:23 UTC, Gerard Seibert
no flags Details
[patch] move libEGL aside (1.60 KB, patch)
2014-11-19 22:29 UTC, Nikolai Lifanov
no flags Details | Diff
[patch] move libEGL and libGLESv2 aside (1.81 KB, patch)
2014-11-22 16:27 UTC, Nikolai Lifanov
no flags Details | Diff
Make libEGL, libglesv2 and nvidia-driver do the same as they do for libGL already. (13.79 KB, patch)
2014-11-26 13:29 UTC, Koop Mast
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerard Seibert 2014-11-10 12:23:36 UTC
Created attachment 149256 [details]
Build Log

The port fails to build due to a conflict with "libEGL-9.1.7_4" and possibly others. The older version of "nvidia-driver" was installed and worked fine on this system. The build log is attached.

# uname -a
FreeBSD scorpio.seibercom.net 10.0-RELEASE-p9 FreeBSD 10.0-RELEASE-p9 #0: Mon Sep 15 14:35:52 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-11-11 02:25:47 UTC
Fix synopsis and assign to maintainer.
Comment 2 Kevin Bowling freebsd_committer freebsd_triage 2014-11-15 05:56:59 UTC
It looks like the port does some trickery to install libGL.so to .nvidia, and then hardlinks it to /usr/local/lib/libGL.so at install time.

I think this needs to be done for libEGL.so and libGLESv2.so, and it also needs handling in the mesa versions (graphics/libEGL and graphics/libGLESv2 ports).
Comment 3 Matthew Rezny freebsd_committer freebsd_triage 2014-11-15 18:15:42 UTC
The change on line 302 of the Makefile in the last commit is the culprit. Reverting that change resolves the conflict as nvidia-driver will only install libGL, not libEGL or libglesv2. nvidia-driver conflicts with Mesa 10.3 exactly the same way. There is no build failure, the title is wrong. It is only a conflict caused by the blob throwing bits outside it's playpen.
Comment 4 Matthew Rezny freebsd_committer freebsd_triage 2014-11-15 19:17:12 UTC
To be more explicit, since there was another commit today, it was the change on line 302 in r372382 that causes the conflict.
Comment 5 Gerard Seibert 2014-11-15 19:20:12 UTC
I just tried to install the latest commit and it still failed:

===>   Registering installation for nvidia-driver-340.46
pkg-static: nvidia-driver-340.46 conflicts with libEGL-9.1.7_4 (installs files into the same place).  Problematic file: /usr/local/lib/libEGL.so
To use these drivers, make sure that you have loaded the NVidia kernel
module, by doing

        # kldload nvidia

or adding

        nvidia_load="YES"

to your /boot/loader.conf.

If you build this port with FreeBSD AGP GART driver, make sure you have
agp.ko kernel module installed and loaded, since nvidia.ko will depend
on it, or have your kernel compiled with "device agp".  Otherwise, the
NVidia kernel module will not load.  Also, please set correct value for
``Option "NvAGP"'' in ``Device'' section of your X11 configuration file.

When building with Linux compatibility support, make sure that linux.ko
module is available as well (or have it compiled in kernel).  It can be
loaded via /boot/loader.conf, or later in the boot process if you add

        linux_enable="YES"

to your /etc/rc.conf.

If X.org cannot start and reports

        (EE) NVIDIA(0): Failed to obtain a shared memory identifier.

in /var/log/Xorg.0.log while actually you have ``options SYSVSHM''
enabled in kernel, the sysctl ``kern.ipc.shmall'' should be increased.

See /usr/local/share/doc/NVIDIA_GLX-1.0/README for more information.

*** Error code 70

Stop.
make[1]: stopped in /usr/ports/x11/nvidia-driver
*** Error code 1

Stop.
make: stopped in /usr/ports/x11/nvidia-driver
Comment 6 Alexey Dokuchaev freebsd_committer freebsd_triage 2014-11-16 11:19:04 UTC
*** Bug 194886 has been marked as a duplicate of this bug. ***
Comment 7 Alexey Dokuchaev freebsd_committer freebsd_triage 2014-11-16 11:23:50 UTC
(In reply to Gerard Seibert from comment #5)
> I just tried to install the latest commit and it still failed:

Right; the latest commit (I presume you've meant ports 372606) was concerning legacy driver branch (304.xx) and did not address this very conflict.

It will be handled in another commit after I work out the details with x11@.
Comment 8 Gerard Seibert 2014-11-16 11:47:08 UTC
Sounds like a man with a plan. Good luck, I really need this driver.
Comment 9 Nikolai Lifanov 2014-11-19 22:27:56 UTC
I ran into this as well while trying out Gnome 3 (didn't need libEGL before this).
I'm attaching a patch that moves nvidia-driver libEGL aside.
Comment 10 Nikolai Lifanov 2014-11-19 22:29:30 UTC
Created attachment 149607 [details]
[patch] move libEGL aside

This fixes install of gnome3.
Comment 11 Nikolai Lifanov 2014-11-19 22:34:39 UTC
Caveat: I still need to test runtime. I'm not at the computer in question yet.
Comment 12 Nikolai Lifanov 2014-11-19 23:29:37 UTC
Well, this works quite well. I'm enjoying my shiny new Gnome 3 desktop accelerated by Nvidia right now.
Comment 13 Gerard Seibert 2014-11-22 13:34:36 UTC
Is there any ETA for a fix for this bug? I could test one if it is available.
Comment 14 Nikolai Lifanov 2014-11-22 14:27:08 UTC
Try my patch. I've been using it since the Gnome 3 import and it works for me.
Comment 15 Gerard Seibert 2014-11-22 15:22:22 UTC
(In reply to Nikolai Lifanov from comment #14)
> Try my patch. I've been using it since the Gnome 3 import and it works for
> me.

I applied your patch and then tried to build the port. I am now getting a slightly different error message:

--->  Installing the new version via the port
===>  Installing for nvidia-driver-340.46_1
===>   nvidia-driver-340.46_1 depends on file: /compat/linux/etc/fedora-release - found
===>   nvidia-driver-340.46_1 depends on file: /usr/local/libdata/pkgconfig/xorg-server.pc - found
===>   nvidia-driver-340.46_1 depends on shared library: libGL.so - found (/usr/local/lib/libGL.so)
===>   Registering installation for nvidia-driver-340.46_1
pkg-static: nvidia-driver-340.46_1 conflicts with libglesv2-10.3.2 (installs files into the same place).  Problematic file: /usr/local/lib/libGLESv2.so
To use these drivers, make sure that you have loaded the NVidia kernel
module, by doing

        # kldload nvidia

or adding

        nvidia_load="YES"

to your /boot/loader.conf.

If you build this port with FreeBSD AGP GART driver, make sure you have
agp.ko kernel module installed and loaded, since nvidia.ko will depend
on it, or have your kernel compiled with "device agp".  Otherwise, the
NVidia kernel module will not load.  Also, please set correct value for
``Option "NvAGP"'' in ``Device'' section of your X11 configuration file.

When building with Linux compatibility support, make sure that linux.ko
module is available as well (or have it compiled in kernel).  It can be
loaded via /boot/loader.conf, or later in the boot process if you add

        linux_enable="YES"

to your /etc/rc.conf.

If X.org cannot start and reports

        (EE) NVIDIA(0): Failed to obtain a shared memory identifier.

in /var/log/Xorg.0.log while actually you have ``options SYSVSHM''
enabled in kernel, the sysctl ``kern.ipc.shmall'' should be increased.

See /usr/local/share/doc/NVIDIA_GLX-1.0/README for more information.

*** Error code 70

Stop.
make[1]: stopped in /usr/ports/x11/nvidia-driver
*** Error code 1

Stop.
make: stopped in /usr/ports/x11/nvidia-driver
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20141122-92600-192gkvy env make reinstall
** Fix the installation problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! x11/nvidia-driver     (install error)
Comment 16 Nikolai Lifanov 2014-11-22 16:27:51 UTC
Created attachment 149714 [details]
[patch] move libEGL and libGLESv2 aside

Try this patch instead. It moves aside libGLESv2 in addition to libEGL.
Comment 17 Gerard Seibert 2014-11-22 17:16:11 UTC
Okay, it seems to be working.  When patched, this was the output:

/usr/ports/x11/nvidia-driver # patch < ./libGEL-patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: Makefile
|===================================================================
|--- Makefile   (revision 373062)
|+++ Makefile   (working copy)
--------------------------
Patching file Makefile using Plan A...
Hunk #1 succeeded at 13.
Hunk #2 succeeded at 241.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: pkg-plist
|===================================================================
|--- pkg-plist  (revision 373062)
|+++ pkg-plist  (working copy)
--------------------------
Patching file pkg-plist using Plan A...
Hunk #1 succeeded at 1.
Hmm...  Ignoring the trailing garbage.
done

The build went fine. I rebooted and then ran pciconf -l -v and got this:

vgapci0@pci0:3:0:0:     class=0x030000 card=0x00000000 chip=0x0a2010de rev=0xa2 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GT216 [GeForce GT 220]'
    class      = display
    subclass   = VGA

KDE is also now using the driver and the screen is much clearer.

I have no idea though if there are any problems with other programs yet.
Comment 18 Gerard Seibert 2014-11-24 13:04:27 UTC
After several days, I have not experienced any problems with the port after the patch was applied. Will the nvidia-driver port be updated soon? I am sure others have had a problem with it also.
Comment 19 Alexey Dokuchaev freebsd_committer freebsd_triage 2014-11-24 14:57:47 UTC
(In reply to Gerard Seibert from comment #18)
> Will the nvidia-driver port be updated soon? I am sure others have had a problem with it also.

Yes, the patch is in the works; proposed solutions (attached to this bug) are vastly incomplete; handling this conflict correctly would require patching all three libraries' (libGL, libEGL, libGLESv2) and NVidia driver port, both Makefiles and deinstall scripts.  Some details can be found in 195080.
Comment 20 Koop Mast freebsd_committer freebsd_triage 2014-11-26 13:29:26 UTC
Created attachment 149887 [details]
Make libEGL, libglesv2 and nvidia-driver do the same as they do for libGL already.

This is my patch for the problem. I copied the method in the previous patch since that was a log nicer then what I came up with.

For nvidia-driver did the following:
Make sure libEGL.so and libGLESv2.so exist in the nvidia version before doing anything. This means in the Makefile and pkg-[de]install scripts, so we don't break the older ports :)
Comment 21 commit-hook freebsd_committer freebsd_triage 2014-11-27 13:14:13 UTC
A commit references this bug:

Author: kwm
Date: Thu Nov 27 13:14:10 UTC 2014
New revision: 373483
URL: https://svnweb.freebsd.org/changeset/ports/373483

Log:
  Fix libEGL and libGLESv2 conflict between libEGL/libglesv2 and the
  nvidia-driver port in the same fashion it was done as the conflict
  with the libGL port.

  Mesa ports:
  Add pkg-[de]install scripts to handle the symlinks in the libEGL
    and libglesv2 port.
  Move pkg-[de]install scripts of libGL out of files/
  Put the real mesa libraries into lib/.mesa so we don't have each
    port create a directory for it own use.

  Nvidia-driver:
  Only apply the libEGL.so and libGLESv2.so alternative install
    directory if nvidia-driver actually ships them. Copied from
    PR submitter, since it was much cleaner then my initial attempt.
  Make pkg-install script check if the nvidia-driver port installed
    the libEGL/libglesv2 libraries and only then make the symlinks.
    This should allow the script to work with the slave ports which
    don't install these libraries.
  Make the pkg-deinstall script check if the mesa version of
   the libEGL/libGLESv2 libraries are installed before trying to
   recreate the symlinks of those ports.

  PR:		194924
  Submitted by:	Gerard Seibert <gerard_seibert@outlook.com>
  Approved by:	portmgr (angrybapt)

Changes:
  head/graphics/libEGL/Makefile
  head/graphics/libEGL/pkg-deinstall
  head/graphics/libEGL/pkg-install
  head/graphics/libEGL/pkg-plist
  head/graphics/libGL/Makefile
  head/graphics/libGL/bsd.mesalib.mk
  head/graphics/libGL/files/pkg-deinstall.in
  head/graphics/libGL/files/pkg-install.in
  head/graphics/libGL/files-old/pkg-deinstall.in
  head/graphics/libGL/files-old/pkg-install.in
  head/graphics/libGL/pkg-deinstall
  head/graphics/libGL/pkg-install
  head/graphics/libGL/pkg-plist
  head/graphics/libglesv2/Makefile
  head/graphics/libglesv2/pkg-deinstall
  head/graphics/libglesv2/pkg-install
  head/graphics/libglesv2/pkg-plist
  head/x11/nvidia-driver/Makefile
  head/x11/nvidia-driver/files/pkg-deinstall.in
  head/x11/nvidia-driver/files/pkg-install.in
  head/x11/nvidia-driver/pkg-plist
Comment 22 Koop Mast freebsd_committer freebsd_triage 2014-11-27 13:16:26 UTC
The problem has been resolved. danfe@ if the solution isn't to your liking, I'm willing to work with you to get it into shape.