0

I am trying to build tensorflow from source with gpu support, following the official instructions: https://www.tensorflow.org/install/source

I run

python configure.py

and eventually I am asked to provide the path to my CUDA libraries. My CUDA installation is installed via conda and therefore resides at

~/miniconda3/lib/python3.9/site-packages/tensorflow/include/tensorflow/core/platform/cuda.h

so I enter

~/miniconda3/lib/python3.9/site-packages/tensorflow/include/tensorflow/core/platform

I get the following error:

Traceback (most recent call last):
  File "somepath/tensorflow/third_party/gpus/find_cuda_config.py", line 647, in <module>
    main()
  File "somepath/tensorflow/third_party/gpus/find_cuda_config.py", line 639, in main
    for key, value in sorted(find_cuda_config().items()):
  File "somepath/tensorflow/third_party/gpus/find_cuda_config.py", line 577, in find_cuda_config
    result.update(_find_cuda_config(cuda_paths, cuda_version))
  File "somepath/tensorflow/third_party/gpus/find_cuda_config.py", line 255, in _find_cuda_config
    cuda_header_path, header_version = _find_header(base_paths, "cuda.h",
  File "somepath/tensorflow/third_party/gpus/find_cuda_config.py", line 243, in _find_header
    return _find_versioned_file(base_paths, _header_paths(), header_name,
  File "somepath/tensorflow/third_party/gpus/find_cuda_config.py", line 233, in _find_versioned_file
    actual_version = get_version(file)
  File "somepath/tensorflow/third_party/gpus/find_cuda_config.py", line 250, in get_header_version
    version = int(_get_header_version(path, "CUDA_VERSION"))
ValueError: invalid literal for int() with base 10: ''

My cudatoolkit version is 11.3.1, which I entered when prompted for CUDA SDK version earlier during the configuration process. (I also tried entering just 11)

Thanks in advance!

Konqi
  • 93
  • 1
  • 8
  • Conda doesn't install a CUDA toolkit which can be used to compile code, despite what it might tell you – talonmies Oct 14 '21 at 14:04
  • 1
    Despite your comment in the reopen vote, your question is really "Why can't I compile using the conda installed cudatoolkit?", to which the answer is "because it just contains selected runtime component, it isn't actually a cuda toolkit and can't be used to build code". If you want to ask a question specifically about building Tensorflow from source, by all means, but this isn't that question. If you read any guide to building Tensorflow, the first or second step will be installing a CUDA toolkit. You didn't do that, the linked answer explains exactly why – talonmies Oct 15 '21 at 03:13
  • 1
    "While the suggested topic contains the answer to my question, it does not addres [sic] my specific Problem in a way that someone else will easily find the answer."–The close reason includes a link to the question, so anyone who finds this question is directed to the other, with the answer. This is how SO is designed to work. – outis Oct 15 '21 at 07:10
  • As far as I can tell, you can not find closed questions. I might be wrong about that, but I certainly can not find this question while not logged in. – Konqi Oct 16 '21 at 20:39
  • 1
    Closed questions are perfectly visible in search. How visible depends on how many votes they have. Your question is visible in search: https://stackoverflow.com/search?q=valueerror-invalid-literal-for-int-with-base-10-while-building-tensorflow – talonmies Oct 17 '21 at 04:46

0 Answers0