Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 606610 - x11-drivers/nvidia-drivers-378.09[wayland] should install 10_nvidia_wayland.json in /usr/share/egl/egl_external_platform.d/
Summary: x11-drivers/nvidia-drivers-378.09[wayland] should install 10_nvidia_wayland.j...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-01-20 14:46 UTC by Pablo Cholaky
Modified: 2018-02-27 04:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
EGL Wayland fix (nvidia-drivers-378.09-waylandfix.patch,811 bytes, patch)
2017-01-20 14:46 UTC, Pablo Cholaky
Details | Diff
eglinfo instructions pre / post fix (eglinfo_changes.txt,2.40 KB, text/plain)
2017-01-20 14:47 UTC, Pablo Cholaky
Details
eglinfo test with strace (tests.log,78.78 KB, text/x-log)
2017-01-24 15:58 UTC, Pablo Cholaky
Details
Proposed fix for nvidia-drivers-378.13 (nvidia-drivers-378.13.ebuild,15.49 KB, text/plain)
2017-03-23 22:58 UTC, Pablo Cholaky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo Cholaky 2017-01-20 14:46:37 UTC
Created attachment 460748 [details, diff]
EGL Wayland fix

Current ebuild for 378.09 added new wayland json under the new feature added on that version, but the path is incorrect following the documentation under README.txt line 658. Also, I had to rename the file libnvidia-egl-wayland.so.1.0.0 to libnvidia-egl-wayland.so.1. 

A Wayland EGL external platform library
     ('/usr/lib/libnvidia-egl-wayland.so.1') and its corresponding
     configuration file (
     '/usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json' ); this
     library provides client-side Wayland support on top of the EGLDevice and
     EGLStream families of extensions, for use in combination with an
     EGLStream-enabled Wayland compositor:
     https://cgit.freedesktop.org/~jjones/weston/

I'm attaching a patch file correcting those changes, because is the only way to make the wayland EGL instruction to appear.

Under strace, those are the correct folders to find the libnvidia-egl-wayland.so.1:

open("/lib64/tls/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
open("/lib64/tls/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
open("/lib64/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
open("/lib64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
open("/usr/lib64/tls/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
open("/usr/lib64/tls/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
open("/usr/lib64/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
open("/usr/lib64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)

Also, correcting both files, you will see the new instructions as explained in the new file.
Comment 1 Pablo Cholaky 2017-01-20 14:47:06 UTC
Created attachment 460750 [details]
eglinfo instructions pre / post fix
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2017-01-21 14:20:32 UTC
Comment on attachment 460748 [details, diff]
EGL Wayland fix

>diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-378.09.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-378.09.ebuild
>index 5daae3070..44b3d3a26 100644
>--- a/x11-drivers/nvidia-drivers/nvidia-drivers-378.09.ebuild
>+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-378.09.ebuild
>@@ -465,8 +465,9 @@ src_install-libs() {
> 
> 		if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
> 		then
>+		    mv ${NV_OBJ}/libnvidia-egl-wayland.so.1.0.0 ${NV_OBJ}/libnvidia-egl-wayland.so.1
> 			NV_GLX_LIBRARIES+=(
>-				"libnvidia-egl-wayland.so.1.0.0"
>+				"libnvidia-egl-wayland.so.1"
> 			)
> 		fi

This is incorrect. It should create a symlink or two instead of moving the library.
Comment 3 Pablo Cholaky 2017-01-21 22:09:08 UTC
Yeah, I figurated that out, but with that change was already creating the symlink with some reason, I'm not portage expert, but installing it with that patch it results:

$ equery f nvidia-drivers | grep wayland
/usr/lib64/libnvidia-egl-wayland.so
/usr/lib64/libnvidia-egl-wayland.so.1
/usr/lib64/libnvidia-egl-wayland.so.1.0.0
/usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json

In other words, the 1 and 1.0,0 area already there, I don't know if gets created because the donvidia() function or after that.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2017-01-24 12:32:56 UTC
(In reply to Pablo Cholaky from comment #0)

> open("/lib64/tls/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> open("/lib64/tls/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> open("/lib64/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> open("/lib64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> open("/usr/lib64/tls/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> open("/usr/lib64/tls/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> open("/usr/lib64/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> open("/usr/lib64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)

What program is doing that?
Comment 5 Pablo Cholaky 2017-01-24 13:52:46 UTC
(In reply to Jeroen Roovers from comment #4)
> (In reply to Pablo Cholaky from comment #0)
> 
> > open("/lib64/tls/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> > open("/lib64/tls/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> > open("/lib64/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> > open("/lib64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> > open("/usr/lib64/tls/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> > open("/usr/lib64/tls/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> > open("/usr/lib64/x86_64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> > open("/usr/lib64/libnvidia-egl-wayland.so.1", O_RDONLY|O_CLOEXEC)
> 
> What program is doing that?

$ strace eglinfo, part of mesa-progs
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2017-01-24 15:44:02 UTC
(In reply to Pablo Cholaky from comment #5)
> $ strace eglinfo, part of mesa-progs

OK, thanks. Perhaps I can reproduce that.
Comment 7 Pablo Cholaky 2017-01-24 15:58:24 UTC
Created attachment 461252 [details]
eglinfo test with strace

Please look this example. I just run this command:

mv /usr/share/egl/egl_external_platform.d/ /tmp && strace eglinfo &> tests.log && printf "\n\n" >> tests.log && mv /tmp/egl_external_platform.d/ /usr/share/egl/ && strace eglinfo &>> tests.log

Basically is removing my already installed egl_external_platform.d and testing eglinfo with strace, then adding it again and running eglinfo with strace to check the difference.

On tests.log, look line 132-133 (without egl_external_platform.d) and line 661-662 (with egl_external_platform.d)

Regards.
Comment 8 Pablo Cholaky 2017-03-23 22:58:52 UTC
Created attachment 468108 [details]
Proposed fix for nvidia-drivers-378.13

To move forward on this, what do you suggest right now? I can propose for nvidia-drivers-378.13 this kind of change. It also works:

468a472
>                       mv ${NV_OBJ}/libnvidia-egl-wayland.so.1.0.1 ${NV_OBJ}/libnvidia-egl-wayland.so.1
470c474
<                               "libnvidia-egl-wayland.so.1.0.1"
---
>                               "libnvidia-egl-wayland.so.1"

I'm really sorry this ebuild contains some extra content to workaround a fix for Linux >=4.10.x, but please consider the above changes.

This would work because it looks like the .so.1 is the important here, and 1.0.1 isn't. And the current ebuild architecture wouldn't do symlinks from .so.1.x.x to .so.1. Doing this would need a major change I think and may lead to other bugs.

What do you say? You may just use cp instead mv and the result should be quite similar.
Comment 9 Pablo Cholaky 2018-02-27 04:26:38 UTC
This package is obsolete right now.