with older driver versions it was possible to install and use CUDA/OpenCL without need of install the X system using use flag 'x'. Now the logic in the new ebuild was rewritten which enforces to enable 'x' use flag to get CUDA/OpenCL support. Reproducible: Always
Created attachment 428604 [details] system.info
Same issue with 4 pc without X server OpenCL stop to work with nvidia-drivers >252.xx Only one pc run openCl fine with latest nvidia-drivers and X-server running regards
Created attachment 428686 [details] debug-nvidia-drivers.log.tbz2
try new nvidia-drivers install (361.18 , 358.15 , 355.11) drivers seem successfuly installed but : "* Adding module to moduledb. !!! Error: Unrecognized option: nvidia exiting" ######### >>> Installing (1 of 1) x11-drivers/nvidia-drivers-358.16-r1::gentoo * Removing /usr/share/doc * >>> SetUID: [chmod go-r] /opt/bin/nvidia-modprobe ... [ ok ] * Removing x11-drivers/nvidia-drivers-352.63 from moduledb. * Updating module dependencies for 4.1.15-gentoo-r1 ... [ ok ] * Adding module to moduledb. !!! Error: Unrecognized option: nvidia exiting * You have elected to not install the X.org driver. Along with * this the OpenGL libraries and VDPAU libraries were not * installed. Additionally, once the driver is loaded your card * and fan will run at max speed which may not be desirable. * Use the 'nvidia-smi' init script to have your card and fan * speed scale appropriately. * * USE=tools controls whether the nvidia-settings application * is installed. If you would like to use it, enable that * flag and re-emerge this ebuild. Optionally you can install * media-video/nvidia-settings * * Messages for package x11-drivers/nvidia-drivers-358.16-r1: * You have elected to not install the X.org driver. Along with * this the OpenGL libraries and VDPAU libraries were not * installed. Additionally, once the driver is loaded your card * and fan will run at max speed which may not be desirable. * Use the 'nvidia-smi' init script to have your card and fan * speed scale appropriately. * * USE=tools controls whether the nvidia-settings application * is installed. If you would like to use it, enable that * flag and re-emerge this ebuild. Optionally you can install * media-video/nvidia-settings * >>> Auto-cleaning packages... >>> No outdated packages were found on your system. * GNU info directory index is up-to-date. No nvidia opencl available eselect opencl list Available OpenCL implementations: [1] mesa merging nvidia-drivers with --debug option get : + //usr/bin/eselect opencl set --use-old nvidia !!! Error: Unrecognized option: nvidia exiting see full attachment
Same with nvidia-drivers-364.12-r1. Any particular reason for this? Why the need to install a full X server system?
Comment on attachment 428686 [details] debug-nvidia-drivers.log.tbz2 I have no idea what this is.
Created attachment 439072 [details, diff] nvidia-drivers-361.28.ebuild patch an easy workaround for installing (opencl) libraries without enabling the X use flag and it's dependencies...
Hi Frank, thanks for this but opencl still not works nvidia-drivers-361.28 installed and loaded lsmod | grep nvidia nvidia 9305080 0 but no opencl available for nvidia eselect opencl list Available OpenCL implementations: [1] intel equery u nvidia-drivers [ Legend : U - final flag setting for installation] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for x11-drivers/nvidia-drivers-361.28: U I - - X : Install the X.org driver, OpenGL libraries, XvMC libraries, and VDPAU libraries + + acpi : Add support for Advanced Configuration and Power Interface - - compat : Install non-GLVND libGL for backwards compatibility + - driver : Install the kernel driver module - - gtk3 : Install nvidia-settings with support for GTK+ 3 + - kms : Enable support for kernel mode setting (KMS) + + multilib : On 64bit systems, if you want to be able to compile 32bit and 64bit binaries - - pax_kernel : PaX patches from the PaX project - - static-libs : Build static versions of dynamic libraries as well - - tools : Install additional tools such as nvidia-settings + - uvm : Install the Unified Memory kernel module (nvidia-uvm) for sharing memory between CPU and GPU in CUDA programs any suggestions ? :) cheers
(In reply to Sabayonino from comment #8) > Hi Frank, thanks for this but opencl still not works > > nvidia-drivers-361.28 installed and loaded > > lsmod | grep nvidia > nvidia 9305080 0 > > > but no opencl available for nvidia > > eselect opencl list > Available OpenCL implementations: > [1] intel > > > > equery u nvidia-drivers > [ Legend : U - final flag setting for installation] > [ : I - package is installed with flag ] > [ Colors : set, unset ] > * Found these USE flags for x11-drivers/nvidia-drivers-361.28: > U I > - - X : Install the X.org driver, OpenGL libraries, XvMC > libraries, and VDPAU libraries > + + acpi : Add support for Advanced Configuration and Power Interface > - - compat : Install non-GLVND libGL for backwards compatibility > + - driver : Install the kernel driver module > - - gtk3 : Install nvidia-settings with support for GTK+ 3 > + - kms : Enable support for kernel mode setting (KMS) > + + multilib : On 64bit systems, if you want to be able to compile 32bit > and 64bit binaries > - - pax_kernel : PaX patches from the PaX project > - - static-libs : Build static versions of dynamic libraries as well > - - tools : Install additional tools such as nvidia-settings > + - uvm : Install the Unified Memory kernel module (nvidia-uvm) for > sharing memory between CPU and GPU in CUDA programs > > any suggestions ? > :) > cheers you should apply the above attached patch to the ebuild and then emerge it with the opencl use flag enabled.
Comment on attachment 439072 [details, diff] nvidia-drivers-361.28.ebuild patch 1. Inverted patch. 2. Looks like a hack: why would you want all of the GLX libraries without USE=X? Wouldn't it be better to separate out the OpenCL specific libraries using a new USE flag, and then change virtual/opencl to depend on x11-drivers/nvidia-drivers[opencl]?
of course, mine was just a quick workaround, not a proposal...
nvidia-352.63 are latest working drivers with OpenCL I can see /etc/OpenCL/* , /usr/lib{32,64}/OpenCL/* directories I can't see /usr/lib32/OpenCL directories with >=nvidia-352.79 /usr/lib64/OpenCL directory exists. there is a broken link in /usr/lib32/libOpenCL.so that point to OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 forcing ABI_X86="32 64" doesn't solve. get follow contents *** nvidia-352.63 *** (OpenCL working) /usr/lib32/OpenCL/vendors/nvidia libOpenCL.so -> libOpenCL.so.1 libOpenCL.so.1 -> libOpenCL.so.1.0.0 libOpenCL.so.1.0.0 /usr/lib64/OpenCL/global/include/CL cl_ext.h cl_gl_ext.h cl_gl.h cl.h cl.hpp cl_platform.h opencl.h *** nvidia 367.27 or lower *** /usr/lib64/OpenCL/global/include/CL cl_ext.h cl_gl_ext.h cl_gl.h cl.h cl.hpp cl_platform.h opencl.h /usr/lib32 has no OpenCL directory. :)
sorry for a new post *** 352.63 *** /usr/lib32 contents ls | grep nvidia libnvidia-compiler.so libnvidia-compiler.so.1 libnvidia-compiler.so.352.63 libnvidia-ml.so libnvidia-ml.so.1 libnvidia-ml.so.352.63 libnvidia-opencl.so libnvidia-opencl.so.1 libnvidia-opencl.so.352.63 *** >252.63 *** Missed Does ABI_X86="32 64" or "multilib" useflag working bad ? :) cheers
The need for glx, opencl, cuda libraries without X usually arises on headless servers running (usually some form of scientific) computation on the GPU.
(In reply to Zoltan Puskas from comment #14) > The need for glx, opencl, cuda libraries without X usually arises on > headless servers running (usually some form of scientific) computation on > the GPU. I'm running BOINC (and only this) in several PCs without X-Server. I don't need "X". I'm playing all boinc-clients remotely or by command line.
Created attachment 444198 [details, diff] nvidia-drivers-361.28.ebuild.patch (In reply to Jeroen Roovers from comment #10) > Comment on attachment 439072 [details, diff] [details, diff] > nvidia-drivers-361.28.ebuild patch > > 1. Inverted patch. > 2. Looks like a hack: why would you want all of the GLX libraries without > USE=X? > > Wouldn't it be better to separate out the OpenCL specific libraries using a > new USE flag, and then change virtual/opencl to depend on > x11-drivers/nvidia-drivers[opencl]? here it goes again... this ebuild patch adds an "opencl" use flag (enabled by default) which only installs needed opencl/cuda libraries (leaving out opengl and unneeded stuff). again, this works for me and i don't have idea what i did
*** Bug 592984 has been marked as a duplicate of this bug. ***
(In reply to frank from comment #16) > Created attachment 444198 [details, diff] [details, diff] > nvidia-drivers-361.28.ebuild.patch > > (In reply to Jeroen Roovers from comment #10) > > Comment on attachment 439072 [details, diff] [details, diff] [details, diff] > > nvidia-drivers-361.28.ebuild patch > > > > 1. Inverted patch. > > 2. Looks like a hack: why would you want all of the GLX libraries without > > USE=X? > > > > Wouldn't it be better to separate out the OpenCL specific libraries using a > > new USE flag, and then change virtual/opencl to depend on > > x11-drivers/nvidia-drivers[opencl]? > > here it goes again... > this ebuild patch adds an "opencl" use flag (enabled by default) which only > installs needed opencl/cuda libraries (leaving out opengl and unneeded > stuff). > again, this works for me and i don't have idea what i did Hi I've tried your patch but I've no OpenCL implemetations. drivers are installed Can't running OpenCL apps # eselect opencl list Available OpenCL implementations: [1] mesa [?] x11-drivers/nvidia-drivers (361.28-r100(0/361){tbz2}@10/05/2016 -> 361.28(0/361)^msd{tbz2}): NVIDIA Accelerated Graphics Driver :(
For nvidia-drivers 367.44, I had to use the above patch plus include the following two files under NV_OPENCL_LIBRARIES libnvidia-compiler.so libnvidia-fatbinaryloader.so Only then was I able to run the cuda 8 sdk samples without X.
your patch was applied but I can't see opencl flag after drivers installation Installed versions: 361.28-r100(0/361)^msd{tbz2}[1](01:07:32 PM 10/05/2016)(acpi driver kms multilib uvm -X -gtk3 -pax_kernel -static-libs -tools [1] "local" /usr/local/portage and still can't run OpenCl eselect opencl list Available OpenCL implementations: [1] mesa
(In reply to Brian Munro from comment #19) > For nvidia-drivers 367.44, I had to use the above patch plus include the > following two files under NV_OPENCL_LIBRARIES > > libnvidia-compiler.so > libnvidia-fatbinaryloader.so > > Only then was I able to run the cuda 8 sdk samples without X. I'll try asap tnx
Any news to this? I would like to drop the dependency on the X useflag in the nvidia-cuda-toolkit.
Created attachment 475426 [details, diff] nvidia-drivers-381.22.ebuild.patch
Suggesting the 381.22 patch, from https://github.com/tommie/portage-overlay/blob/eae88761e1e22f17b7faffac3b46c299ff6773e7/x11-drivers/nvidia-drivers/nvidia-drivers-381.22-r1.ebuild I didn't add the opencl USE flag (no regression). Tried to keep it a minimal patch. The library rearrangement is based on doing ldd to see what libraries depend on libX11 et al.
Bumped to 384.47 https://github.com/gentoo/gentoo/pull/5188
*** Bug 663830 has been marked as a duplicate of this bug. ***
bumping this as well
Created attachment 585928 [details, diff] nvidia-drivers-430.40.ebuild Based on Tommie's patches but also fixes the modprobe config
Why is this still a thing? CUDA/opencl librarys depended on X, also installing of libnvidia-ml.so is depended on X, so if you run nvidia-smi it complains that it cant find library... however if you remove all X dependency nvidia-smi and opencl seems to work... im using nvidia graphics card in a server without X, but i still want to have cuda/opencl librarys and basic access to temperatures....
Again, very much need this fix. The patch seems to work for me (with a slight tweak to drop fatbinary), is there anything more that we (or I) can do to push this along? P.S. I'd really like to confirm this as both a. it's a problem and b. the patch seems to work for me. P.P.S. In the mean time, does anyone have a solution to mask the nvidia::gentoo packages and still yell loudly when nvidia has been update so as to patch the new version?
(In reply to Alex Orange from comment #30) > Again, very much need this fix. May still have to be patient but just to say this isn't forgotten and will get fixed (I know waiting sound unreasonable when the fix is simple, but there's some re-organization going on).
*** Bug 600182 has been marked as a duplicate of this bug. ***
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26146d1510fd678538b7d02400c1eb8e66e20212 commit 26146d1510fd678538b7d02400c1eb8e66e20212 Author: Ionen Wolkens <sudinave@gmail.com> AuthorDate: 2021-03-21 15:52:10 +0000 Commit: David Seifert <soap@gentoo.org> CommitDate: 2021-03-21 15:52:10 +0000 x11-drivers/nvidia-drivers: bump to 460.67 with refactored ebuild ebuild carries a lot of history and, rather than cleanups, it needed something closer to a rewrite. Bugfixes: - Removed all udev rules to solve long standing issues (bug #454740) - Install libraries with no X11 dependencies with USE=-X, notably for headless OpenCL/CUDA (bug #561706) - Install systemd unit for persistenced + nvpd user (bug #591638) - Add custom error message for DRM_KMS_HELPER and ensure driver doesn't attempt building DRM support without it (bug #603818) - Warn about AMD SME if enabled by default (bug #652408) - Distribute extra sources to lift RESTRICT="bindist mirror", the nvidia-driver.eclass is no longer used (bug #732702) - Build modprobe and persistenced from source (bug #747145) - Use system locations for vulkan icd/layers (bug #749600) Others: - Dropped IUSE=compat/multilib/kms/uvm/wayland > compat: was for non-GLVND variants and currently a no-op > multilib: obsolete, abi_x86_32 does all that's needed > kms/uvm: modules are loaded by nvidia-modprobe as-needed and there's not much sense in skipping installation. Will also save OpenCL/CUDA packages from having to depend on [uvm] > wayland: library is provided by gui-libs/egl-wayland instead which now also provides pkgconfig files and can be a newer version. optfeature warning was added for awareness. - Dropped REQUIRED_USE, all USE can now be used independently, e.g. now possible to get libXNVCtrl.a (static-libs) without the deps-heavy USE=tools - Dropped locale patch, the offending code it was meant to fix is gone. - Dropped linker patch, uses right linker even with -native-symlinks. - Added modprobe.d .conf to blacklist nouveau by default. - Patched nvidia-modprobe to respect nvidia.conf's permissions when creating uvm devices, was previously created as world read-write. - No longer installing libOpenCL.so loader (not needed to use OpenCL, was used by the no longer available eselect-opencl). - nvidia-persistenced init script simplified and updated for nvpd user. - nvidia-smi init script removed (all it did was query cards every 300 seconds), mentioned behavior is no longer observable (fan scales normally without X) and it wasn't intended for this purpose. - Removed I2C_NVIDIA_GPU check as it caused unnecessary noise for gentoo-kernel-bin users (built as module), and being a bad thing even if loaded is questionable. - Attempt to reduce message noise. The only fatal CONFIG_CHECK is fairly rare so there's little reason to check twice with pkg_pretend. - ... but added new conditional messages to explain important things often seen as common sense but that a new user likely won't know. - Replaced the nvidia-driver.eclass legacy test with a compact version that reads supported-gpus.json (usable on >450). - More strict deps, some may sound strange but nvidia-settings only use headers for some of these (dbus/Xrandr/Xv/vdpau). > X? libs kept separate as it's the only one needing multilib deps. > pax-utils now unconditional for scanelf as libraries are always installed. Alternatively could've generated those, but prefer to leave it easier to maintain for future generations. > virtual/opencl removed, no sense in the drivers depending on this and it's instead applications using opencl that should. > Added MODULES_OPTIONAL_USE="driver" to handle linux-mod deps - Added MIT license for persistenced - Added ZLIB license for supported-gpus.json - NV_KERNEL_MAX (previously NV_KV_MAX_PLUS) set to be <=5.11 form rather than <5.12 given that often confused users thinking it meant 5.12 support from quick looks. - arm64 support "should" work but runtime untested - And a long list of cleanups that "hopefully" won't cause new issues. Closes: https://bugs.gentoo.org/454740 Closes: https://bugs.gentoo.org/561706 Closes: https://bugs.gentoo.org/591638 Closes: https://bugs.gentoo.org/603818 Closes: https://bugs.gentoo.org/652408 Closes: https://bugs.gentoo.org/732702 Closes: https://bugs.gentoo.org/747145 Closes: https://bugs.gentoo.org/749600 Signed-off-by: Ionen Wolkens <sudinave@gmail.com> Signed-off-by: David Seifert <soap@gentoo.org> x11-drivers/nvidia-drivers/Manifest | 7 + .../files/nvidia-blacklist-nouveau.conf | 3 + .../files/nvidia-modprobe-390.141-uvm-perms.patch | 12 + .../nvidia-drivers/files/nvidia-persistenced.confd | 7 + .../nvidia-drivers/files/nvidia-persistenced.initd | 12 + .../nvidia-drivers/nvidia-drivers-460.67.ebuild | 391 +++++++++++++++++++++ 6 files changed, 432 insertions(+)