0

Is it possible to determine which installed version of cuda installed tensoflow is using?

i.e. in pytorch I can do: torch._C._cuda_getDriverVersion()

Note: I'm not looking for compatibility combinations like Which TensorFlow and CUDA version combinations are compatible?

talonmies
  • 68,743
  • 34
  • 184
  • 258
mrgloom
  • 17,637
  • 28
  • 146
  • 263

1 Answers1

1

There doesn't seem to be an API to check the CUDA version. But there is a hacky way, which is to print the shared library dependencies of tensorflow internal library.

python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib() + "/python/_pywrap_tensorflow_internal.so")' | xargs ldd |grep cuda

libcublas.so.10.0 => /usr/local/cuda/lib64/libcublas.so.10.0 (0x00007f398a94e000)
libcusolver.so.10.0 => /usr/local/cuda/lib64/libcusolver.so.10.0 (0x00007f3982267000)
libcudart.so.10.0 => /usr/local/cuda/lib64/libcudart.so.10.0 (0x00007f3981fed000)

https://github.com/tensorflow/tensorflow/issues/10827

Manoj Mohan
  • 5,334
  • 1
  • 15
  • 20