简体   繁体   中英

Tensorflow build from source error ValueError: invalid literal for int() with base 10: '' during cuda path configuration?

I'm on ubuntu 20.04 with cuda 10.1 and cudnn 7.6.5-32 and I'm trying to build from source tensorflow 2.3 but I keep getting a value error while using./configure?

Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 10]: 10.1.243         


Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7]: 7.6.5.32


Please specify the locally installed NCCL version you want to use. [Leave empty to use http://github.com/nvidia/nccl]: 


Please specify the comma-separated list of base paths to look for CUDA libraries and headers. [Leave empty to use the default]: /usr/src/linux-headers-5.4.0-42/include/linux/,/usr/src/linux-headers-5.4.0-42/include/uapi/linux/,/usr/src/linux-headers-5.4.0-26/include/uapi/linux/,/usr/src/linux-headers-5.4.0-26/include/linux/,/usr/share/man/man3/,/usr/include/linux/,/usr/include/,/usr/lib/cuda/,/usr/include/


Traceback (most recent call last):
  File "third_party/gpus/find_cuda_config.py", line 648, in <module>
    main()
  File "third_party/gpus/find_cuda_config.py", line 640, in main
    for key, value in sorted(find_cuda_config().items()):
  File "third_party/gpus/find_cuda_config.py", line 578, in find_cuda_config
    result.update(_find_cuda_config(cuda_paths, cuda_version))
  File "third_party/gpus/find_cuda_config.py", line 252, in _find_cuda_config
    cuda_header_path, header_version = _find_header(base_paths, "cuda.h",
  File "third_party/gpus/find_cuda_config.py", line 240, in _find_header
    return _find_versioned_file(base_paths, _header_paths(), header_name,
  File "third_party/gpus/find_cuda_config.py", line 230, in _find_versioned_file
    actual_version = get_version(file)
  File "third_party/gpus/find_cuda_config.py", line 247, in get_header_version
    version = int(_get_header_version(path, "CUDA_VERSION"))
ValueError: invalid literal for int() with base 10: ''
Asking for detailed CUDA configuration...

I ran this command to get the base paths,

$ locate cuda.h

/snap/gnome-3-34-1804/24/usr/include/linux/cuda.h
/snap/gnome-3-34-1804/36/usr/include/linux/cuda.h
/usr/include/cuda.h
/usr/include/linux/cuda.h
/usr/share/man/man3/cuda.h.3.gz
/usr/src/linux-headers-5.4.0-26/include/linux/cuda.h
/usr/src/linux-headers-5.4.0-26/include/uapi/linux/cuda.h
/usr/src/linux-headers-5.4.0-42/include/linux/cuda.h
/usr/src/linux-headers-5.4.0-42/include/uapi/linux/cuda.h

And here are my cuda installation path,

$whereis cuda

cuda: /usr/lib/cuda /usr/include/cuda.h

And here's my nvidia and cuda version,

$ nvcc -V

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

here's my driver

$ nvidia-smi


Sun Aug  2 01:39:54 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100      Driver Version: 440.100      CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 750 Ti  Off  | 00000000:01:00.0  On |                  N/A |
| 27%   41C    P0     1W /  38W |    171MiB /  1997MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1049      G   /usr/lib/xorg/Xorg                            20MiB |
|    0      1859      G   /usr/lib/xorg/Xorg                            44MiB |
|    0      2058      G   /usr/bin/gnome-shell                          94MiB |
+-----------------------------------------------------------------------------+

Building Tensorflow with NVIDIA GPU support (or any CUDA project) from source requires that you have a full CUDA toolkit installed (which implies all of the necessary dependencies which CUDA requires). Note that the conda distributed "cudatoolkit" package is not a full CUDA toolkit and cannot be used to build code.

You do not have a CUDA toolkit installed. Therefore you cannot build Tensorflow.

Install one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM