Is it still necessary to install CUDA before using the conda tensorflow-gpu package?

Do i now have two versions of CUDA installed and how do I check this?

No.

conda installs the bare minimum redistributable library components required to support the CUDA accelerated packages they offer. The package name cudatoolkit is a complete misnomer. It is nothing of the sort. Even though it is now greatly expanded in scope from what it used to be (literally 5 files — I think at some point they must have gotten a licensing deal from NVIDIA because some of this wasn’t/isn’t on the official “freely redistributable” list AFAIK), it still is basically just a handful of libraries.

You can check this for yourself:

cat /opt/miniconda3/conda-meta/cudatoolkit-10.1.168-0.json 
{
  "build": "0",
  "build_number": 0,
  "channel": "https://repo.anaconda.com/pkgs/main/linux-64",
  "constrains": [],
  "depends": [],
  "extracted_package_dir": "/opt/miniconda3/pkgs/cudatoolkit-10.1.168-0",
  "features": "",
  "files": [
    "lib/cudatoolkit_config.yaml",
    "lib/libcublas.so",
    "lib/libcublas.so.10",
    "lib/libcublas.so.10.2.0.168",
    "lib/libcublasLt.so",
    "lib/libcublasLt.so.10",
    "lib/libcublasLt.so.10.2.0.168",
    "lib/libcudart.so",
    "lib/libcudart.so.10.1",
    "lib/libcudart.so.10.1.168",
    "lib/libcufft.so",
    "lib/libcufft.so.10",
    "lib/libcufft.so.10.1.168",
    "lib/libcufftw.so",
    "lib/libcufftw.so.10",
    "lib/libcufftw.so.10.1.168",
    "lib/libcurand.so",
    "lib/libcurand.so.10",
    "lib/libcurand.so.10.1.168",
    "lib/libcusolver.so",
    "lib/libcusolver.so.10",
    "lib/libcusolver.so.10.1.168",
    "lib/libcusparse.so",
    "lib/libcusparse.so.10",
    "lib/libcusparse.so.10.1.168",
    "lib/libdevice.10.bc",
    "lib/libnppc.so",
    "lib/libnppc.so.10",
    "lib/libnppc.so.10.1.168",
    "lib/libnppial.so",
    "lib/libnppial.so.10",
    "lib/libnppial.so.10.1.168",
    "lib/libnppicc.so",
    "lib/libnppicc.so.10",
    "lib/libnppicc.so.10.1.168",
    "lib/libnppicom.so",
    "lib/libnppicom.so.10",
    "lib/libnppicom.so.10.1.168",
    "lib/libnppidei.so",
    "lib/libnppidei.so.10",
    "lib/libnppidei.so.10.1.168",
    "lib/libnppif.so",
    "lib/libnppif.so.10",
    "lib/libnppif.so.10.1.168",
    "lib/libnppig.so",
    "lib/libnppig.so.10",
    "lib/libnppig.so.10.1.168",
    "lib/libnppim.so",
    "lib/libnppim.so.10",
    "lib/libnppim.so.10.1.168",
    "lib/libnppist.so",
    "lib/libnppist.so.10",
    "lib/libnppist.so.10.1.168",
    "lib/libnppisu.so",
    "lib/libnppisu.so.10",
    "lib/libnppisu.so.10.1.168",
    "lib/libnppitc.so",
    "lib/libnppitc.so.10",
    "lib/libnppitc.so.10.1.168",
    "lib/libnpps.so",
    "lib/libnpps.so.10",
    "lib/libnpps.so.10.1.168",
    "lib/libnvToolsExt.so",
    "lib/libnvToolsExt.so.1",
    "lib/libnvToolsExt.so.1.0.0",
    "lib/libnvblas.so",
    "lib/libnvblas.so.10",
    "lib/libnvblas.so.10.2.0.168",
    "lib/libnvgraph.so",
    "lib/libnvgraph.so.10",
    "lib/libnvgraph.so.10.1.168",
    "lib/libnvjpeg.so",
    "lib/libnvjpeg.so.10",
    "lib/libnvjpeg.so.10.1.168",
    "lib/libnvrtc-builtins.so",
    "lib/libnvrtc-builtins.so.10.1",
    "lib/libnvrtc-builtins.so.10.1.168",
    "lib/libnvrtc.so",
    "lib/libnvrtc.so.10.1",
    "lib/libnvrtc.so.10.1.168",
    "lib/libnvvm.so",
    "lib/libnvvm.so.3",
    "lib/libnvvm.so.3.3.0"
  ]

  .....

i.e. what you get is (keeping in mind most of those “files” above are just symlinks)

  • CUBLAS runtime
  • The CUDA runtime library
  • CUFFT runtime
  • CUrand runtime
  • CUsparse rutime
  • CUsolver runtime
  • NPP runtime
  • nvblas runtime
  • NVTX runtime
  • NVgraph runtime
  • NVjpeg runtime
  • NVRTC/NVVM runtime

The CUDNN package that conda installs is the redistributable binary distribution which is identical to what NVIDIA distribute — which is exactly two files, a header file and a library.

You would still require a supported NVIDIA driver installation to make the tensorflow which conda installs work.

If you want to actually compile and build CUDA code, you need to install a separate CUDA toolkit which contains all the the development components which conda deliberately omits from their distribution.

Leave a Comment