Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Support for Nvidia CUDA Toolkit 9.2

What is the reasoning that Tensorflow-gpu is bound to a specific version of Nvidia's CUDA Toolkit? The current version appears to look for 9.0 specifically and will not work with anything greater. For example I installed the latest Toolkit 9.2 and added it to path but Tensorflow-gpu will not work with it and complains that it is looking for 9.0.

I can see major version updates not being supported but a minor release?

like image 303
cjibo Avatar asked May 30 '18 13:05

cjibo


People also ask

Does my NVIDIA support CUDA?

CUDA works with all Nvidia GPUs from the G8x series onwards, including GeForce, Quadro and the Tesla line. CUDA is compatible with most standard operating systems.

Do I need Nvidia Cuda Toolkit?

Cuda needs to be installed in addition to the display driver unless you use conda with cudatoolkit or pip with cudatoolkit. Tensorflow and Pytorch need the CUDA system install if you install them with pip without cudatoolkit or from source.


2 Answers

That's a good question. According to NVidia's website,

The CUDA driver is backward compatible, meaning that applications compiled against a particular version of the CUDA will continue to work on subsequent (later) driver releases.

So technically, it should not be a problem to support later iterations of a CUDA driver. And in practice, you will find working non-official pre-built binaries with later versions of CUDA and CuDNN on the net [1], [2]. Even easier to install, the tensorflow-gpu package installed from conda currently comes bundled with CUDA 9.2.

When asked on the topic, a dev answered,

The answer to why is driver issues in the ones required by 9.1, not many new features we need in cuda 9.1, and a few more minor issues.

So the reason looks rather vague -- he might mean that CUDA 9.1 (and 9.2) requires graphics card driver that are perhaps a bit too recent to be really convenient, but that is an uneducated guess.

If NVidia is right about binary compatibility, you may try to simply rename or link your CUDA 9.2 library as a CUDA 9.0 library and it should work. But I would save all my work before attempting this... and the fact that people go as far as recompiling tensorflow to support later CUDA versions may be a hint on how this could end.

like image 159
P-Gn Avatar answered Oct 21 '22 11:10

P-Gn


When you download TF, you download a pre-built binary file. In the build process TF is hard linked into a specific version of Cuda, so you cannot use it with different cuda versions.

If you want to work with the new (or sometimes older) version of cuda you will need to install TF from source (check how here) Or, if you realy don't want to build yourself, check in these repos, there are others that publish specific TF binaries, few examples:

  • https://github.com/mind/wheels
  • https://github.com/yaroslavvb/tensorflow-community-wheels
  • https://github.com/fo40225/tensorflow-windows-wheel

For your convenience I add here the CUDA + cuDNN versions that are required for each prebuilt Tensorflow version:

(I write here just about the TF versions that I worked with, maybe older TF versions use older versions of CUDA as well)

  • before TF v1.5 cuda 8.0 and cuDNN 6
  • start from: 1.5 - Prebuilt binaries are now built against CUDA 9 and cuDNN 7.
like image 23
Kings85 Avatar answered Oct 21 '22 13:10

Kings85