Bug#767367: nvidia-opencl-icd dependencies

Andreas Beckmann anbe at debian.org
Wed Dec 3 01:20:17 UTC 2014


On 2014-12-02 22:36, Rebecca N. Palmer wrote:
>> what would happen to
>> an Nvidia-hardware-only system with nvidia kernel module (which
>> blacklists the nouveau kernel module) + nouveau graphics userspace,
>> which under [nvidia-kernel-dkms Recommends: nvidia-driver | libcuda1]
>> would be the result of trying to install OpenCL on
>> a previously nouveau-using system.
> 
> Did you test this (i.e. "apt-get install nvidia-opencl-icd libcuda1"
> with Nvidia hardware but no already-installed *nvidia* packages)?
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751082#27 suggests the
> result is no graphics.
> 
> (Having it be a Recommends: nvidia-driver rather than a hard Depends
> already allows the "headless GPGPU" case, and cutting nvidia-opencl-icd
> -> libcuda1 is enough to fix the original "accidental nvidia-opencl-icd
> on inappropriate hardware" problem.)
> 
> _______________________________________________
> pkg-nvidia-devel mailing list
> pkg-nvidia-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-nvidia-devel

# apt-get install --install-recommends nvidia-opencl-icd libcuda1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  cpp-4.8 dkms gcc-4.8 glx-alternative-mesa glx-alternative-nvidia glx-diversions kmod libasan0 libgcc-4.8-dev libkmod2 libnvidia-compiler libnvidia-ml1 linux-compiler-gcc-4.8-x86 linux-headers-3.16.0-4-amd64
  linux-headers-3.16.0-4-common linux-headers-amd64 linux-kbuild-3.16 menu nvidia-alternative nvidia-installer-cleanup nvidia-kernel-common nvidia-kernel-dkms nvidia-modprobe nvidia-opencl-common nvidia-smi
  nvidia-support ocl-icd-libopencl1
Suggested packages:
  gcc-4.8-locales gcc-4.8-multilib gcc-4.8-doc libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg libgl1-mesa-glx libgl1 nvidia-driver nvidia-cuda-mps menu-l10n gksu
  kde-runtime ktsuss opencl-icd
Recommended packages:
  linux-image libcuda1-i386
The following NEW packages will be installed:
  cpp-4.8 dkms gcc-4.8 glx-alternative-mesa glx-alternative-nvidia glx-diversions kmod libasan0 libcuda1 libgcc-4.8-dev libkmod2 libnvidia-compiler libnvidia-ml1 linux-compiler-gcc-4.8-x86
  linux-headers-3.16.0-4-amd64 linux-headers-3.16.0-4-common linux-headers-amd64 linux-kbuild-3.16 menu nvidia-alternative nvidia-installer-cleanup nvidia-kernel-common nvidia-kernel-dkms nvidia-modprobe
  nvidia-opencl-common nvidia-opencl-icd nvidia-smi nvidia-support ocl-icd-libopencl1
0 upgraded, 29 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.3 MB/37.4 MB of archives.
After this operation, 136 MB of additional disk space will be used.

@@@ doing this in a sid chroot ...

# update-alternatives --display nvidia 
nvidia - auto mode
  link currently points to /usr/lib/nvidia/current
/usr/lib/nvidia/current - priority 340
  slave nvidia--libcuda.so-x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu/nvidia/current/libcuda.so
  slave nvidia--libcuda.so.1-x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu/nvidia/current/libcuda.so.1
  slave nvidia--libnvidia-ml.so.1-x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-ml.so.1
  slave nvidia--libnvidia-opencl.so.1-x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-opencl.so.1
  slave nvidia--nvidia-modprobe.conf: /etc/nvidia/nvidia-modprobe.conf
  slave nvidia--nvidia-smi: /usr/lib/nvidia/current/nvidia-smi
  slave nvidia--nvidia-smi.1.gz: /usr/lib/nvidia/current/nvidia-smi.1.gz
Current 'best' version is '/usr/lib/nvidia/current'.

@@@ as expected

# update-alternatives --display glx
update-alternatives: error: no alternatives for glx

@@@ Oops, let's install X, too

# apt-get install --install-recommends xserver-xorg

# update-alternatives --display glx
glx - auto mode
  link currently points to /usr/lib/mesa-diverted
/usr/lib/mesa-diverted - priority 5
  slave glx--libEGL.so.1-x86_64-linux-gnu: /usr/lib/mesa-diverted/x86_64-linux-gnu/libEGL.so.1
  slave glx--libGL.so.1-x86_64-linux-gnu: /usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so.1
Current 'best' version is '/usr/lib/mesa-diverted'.

@@@ as expected

nouveau is not blacklisted ... the kernel module would probably get loaded by a cuda application


Interesting testcase, need to think more about it. For stretch :-)

There is a lever missing here to enable/disable nvidia.
/etc/modules-load.d/ may be useful :-)

And probably a new utility needs to be written to switch the system into any of these (proprietary) gpu modes:
* none (xorg,mesa only)
* nvidia native
* nvidia optimus
* fglrx native
* fglrx the-thing-that-is-equivalent-to-optimus
* bumblebee whatever

It must be possible to have *all* installed at the same time and to switch between them without package removal (since only one can be active at a time).
(and we have at least 2 different nvidia drivers available, more likely 3: current, 340xx, 304xx)


Andreas



More information about the pkg-nvidia-devel mailing list