Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 717042

Summary: x11-drivers/nvidia-drivers USE=uvm - use virtual/opencl instead of app-eselect/eselect-opencl
Product: Gentoo Linux Reporter: Marek Szuba (RETIRED) <marecki>
Component: Current packagesAssignee: Jeroen Roovers (RETIRED) <jer>
Status: RESOLVED FIXED    
Severity: normal CC: cafaia, pacho, redblade7
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: nvidia-drivers-440.82.ebuild.patch

Description Marek Szuba (RETIRED) archtester gentoo-dev 2020-04-11 10:37:02 UTC
x11-drivers/nvidia-drivers[uvm] is the last OpenCL provider currently in the tree which needs to be deployed standalone via eselect-opencl instead of relying on an ICD loader. Last time I had anything to do with Nvidia hardware (which, admittedly, was back in early 2018) I was able to use the already-provided icd file in conjunction with dev-libs/ocl-icd to get runtimes for an Intel CPU, an Intel GPU and a Nvidia GPU operate at the same time, therefore it seems there shouldn't be any technical issues with making the ICD-loader mode mandatory.

Basically, the migration would consists of only two fairly simple steps:

1. Replace the dependency on app-eselect/eselect-opencl with one on >=virtual/opencl-3. Incidentally, it might make sense to make this conditional on USE=uvm - right now eselect-opencl is pulled in unconditionally;

2. Remove the invocation of "eselect opencl" from pkg_postinst().

That said, the fact there are so many different versions and that they are all marked stable might require some thought, at least on the blocker side in dev-libs/ocl-icd and dev-libs/opencl-icd-loader anyway.

Ping me by e-mail or on IRC if you have any questions or need any help with this.
Comment 1 Marek Szuba (RETIRED) archtester gentoo-dev 2020-04-11 21:20:03 UTC
Created attachment 632352 [details, diff]
nvidia-drivers-440.82.ebuild.patch

The enclosed patch shows all that IMHO has to be done here (revbump included), modulo the change of keywords back to ~arch wherever necessary and the fact at least one of the existing ebuilds does not support USE=uvm
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2020-04-20 09:48:02 UTC
(In reply to Marek Szuba from comment #0)
> That said, the fact there are so many different versions and that they are
> all marked stable might require some thought, at least on the blocker side
> in dev-libs/ocl-icd and dev-libs/opencl-icd-loader anyway.

The only problem I see is that dev-libs/ocl-icd and dev-libs/opencl-icd-loader inexplicably block x11-drivers/nvidia-drivers. Why is that?
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2020-04-20 09:59:30 UTC
(In reply to Jeroen Roovers from comment #2)
> (In reply to Marek Szuba from comment #0)
> > That said, the fact there are so many different versions and that they are
> > all marked stable might require some thought, at least on the blocker side
> > in dev-libs/ocl-icd and dev-libs/opencl-icd-loader anyway.
> 
> The only problem I see is that dev-libs/ocl-icd and
> dev-libs/opencl-icd-loader inexplicably block x11-drivers/nvidia-drivers.
> Why is that?

Perhaps it is because of the purported file collisions? They should resolve to no package and get overwritten as intended.
Comment 4 Larry the Git Cow gentoo-dev 2020-04-20 10:14:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea5a35b112853a43358eb494f59abc839e516d6f

commit ea5a35b112853a43358eb494f59abc839e516d6f
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2020-04-20 10:13:48 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2020-04-20 10:14:44 +0000

    x11-drivers/nvidia-drivers: Depend on virtual/opencl
    
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Bug: https://bugs.gentoo.org/717042
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 x11-drivers/nvidia-drivers/nvidia-drivers-390.132-r2.ebuild | 3 +--
 x11-drivers/nvidia-drivers/nvidia-drivers-430.64-r2.ebuild  | 3 +--
 x11-drivers/nvidia-drivers/nvidia-drivers-435.21-r2.ebuild  | 3 +--
 x11-drivers/nvidia-drivers/nvidia-drivers-440.82-r1.ebuild  | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2020-04-20 10:15:29 UTC
$ wings
wings-2.2.5
Reading preferences from: /home/jeroen/.config/Wings3D/Preferences.txt
2020-04-20T12:05:34.197738+02:00 error:
    wx: error
    message: not_supported in wxMenuBar:setAutoWindowMenu/1
OpenCL not available: {opencl_failed_previously,
                          "/home/jeroen/.cache/Wings3D/opencl_tmp.txt"}
Could not initialize OpenCL: env lighting limited
Comment 6 Bug Bugs 2020-05-05 16:37:24 UTC
$ NV_OPENCL_DISABLE_UVM=1 clinfo

Number of platforms                               1
  Platform Name                                   NVIDIA CUDA
  Platform Vendor                                 NVIDIA Corporation
  Platform Version                                OpenCL 1.2 CUDA 10.2.159
  Platform Profile                                FULL_PROFILE
... cut ...

I'm not sure if OpenCL ever worked on my system, but this is how I made it work for current nvidia-drivers and dev-libs/opencl-icd-loader. The last one is what used by NVIDIA, so no need to install loader provided by nvidia-drivers, BTW.
Comment 7 John Blbec 2020-05-21 21:10:17 UTC
why x11-drivers/nvidia-drivers-340.108 isn't supported?
Comment 8 Tom Poplawski 2020-05-25 20:32:58 UTC
Patch closing this bug contained a nvidia-drivers-340.108-r1.ebuild as a new file but not a patch against 340.108.ebuild.  

https://archives.gentoo.org/gentoo-dev/message/9c2da71a159d860aea32ff2b1300ae84

patch applied

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea5a35b112853a43358eb494f59abc839e516d6f

skips 340.108-r1

leaving 340.108 broken.