我试图从源头上构建Tensorflow,因为我有一个6.1计算能力的GPU,然而我的CPU不支持AVX命令。我第一次使用docker容器的尝试失败了,因为Tensorflow也无法在tensorflow:latest-jupyter-gpu上导入。我已经从nvidia网站上手动安装了cuda驱动,并验证了CUDA驱动。根据
nvidia-smi
的输出,当前的安装是
NVIDIA-SMI 450.51.05 Driver Version: 450.51.05 CUDA Version: 11.0
。此外,我已经安装并验证了CUDA 11的cudnn-8.0.1的安装,方法如下
this
指南。我的系统运行Linux Mint 19.1。
我已经下载了TF源码,并查看了分支r2.2来构建相应的版本。尽管建议的方法是通过Bazelisk安装Bazel (
from this guide
),唯一有效的方法是通过应用命令
cd "/home/user/.bazel/bin" && curl -LO https://releases.bazel.build/2.0.0/release/bazel-2.0.0-linux-x86_64 && chmod +x bazel-2.0.0-linux-x86_64
然而在配置建设中,我必须处理两个问题。
When choosing about the supported libraries, if only select CUDA out of the 4 questioned libraries, I get the following error:
File "./configure.py", line 1440, in main
if validate_cuda_config(environ_cp):
File "./configure.py", line 1323, in validate_cuda_config
tuple(line.decode('ascii').rstrip().split(': ')) for line in proc.stdout)
ValueError: dictionary update sequence element #9 has length 1; 2 is required
因此,我必须选择至少两个库(CUDA和TensorRT)。
In case of selecting the two libraries then the script proceeds, however, the following message occurs
Could not find any NvInferVersion.h matching version '' in any subdirectory. After providing CUDA and cudnn versions at the corresponding script prompts I have managed to proceed further by finding in my system cudnn.h and cuda.h paths and adding their paths in the additional scripts prompt:
Please specify the comma-separated list of base paths to look for CUDA libraries and headers. [Leave empty to use the default]: /usr/local/cuda-11.0/targets/x86_64-linux/include/cuda.h,/usr/include/hwloc/cuda.h,/usr/local/cuda-11.0/targets/x86_64-linux/include/cudnn.h,/usr/include/cudnn.h,/usr/include/linux,/usr/local/cuda/include
但是我不能再继续下去了,因为脚本一直在失败,出现了这样的信息。
Could not find any cuda.h matching version '11' in any subdirectory:
'include'
'include/cuda'
'include/*-linux-gnu'
'extras/CUPTI/include'
'include/cuda/CUPTI'
'/usr/include/hwloc/cuda.h'
'/usr/local/cuda-11.0/targets/x86_64-linux/include/cuda.h'
'/usr/local/cuda-11.0/targets/x86_64-linux/include/cudnn.h'
Asking for detailed CUDA configuration...
有没有关于如何继续的提示?哪些应该是我必须提供的路径?