编译安装tensorflow遭心的问题-记录一下

由于tensorflow 支持的GPU的算力必须》=3.5,而我的GPU的算力=3.0(GTX 870M),如果要支持的话,需要重新编译tensorflow(并且每次都打印出来日至,我的cpu支持xxx指令,而编译的时候没有支持等词类问题),为了一次性解决,索性编译一下,过程自然是痛苦的。

由于这次异常痛苦,因此特此记录一下。

原因是正常编译的过程中出现了ascii codec can't decode byte 0xef。一直以为是我的安装包存在中文导致的,经过几番折腾,并没有什么用。

于是打算研究研究/root/tensorflow/third_party/remote_config/common.bzl,bzl文件兼容python语法。

直接上问题 

ERROR: An error occurred during the fetch of repository 'local_config_cuda':
   Traceback (most recent call last):
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 1213
        _create_local_cuda_repository(<1 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 935, in _create_local_cuda_repository
        _find_libs(repository_ctx, <2 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 578, in _find_libs
        _check_cuda_libs(repository_ctx, <2 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 480, in _check_cuda_libs
        execute(repository_ctx, <1 more arguments>)
    File "/root/tensorflow/third_party/remote_config/common.bzl", line 209, in execute
        fail(<1 more arguments>)
Repository command failed
Traceback (most recent call last):
  File "script.py", line 88, in <module>
    main()
  File "script.py", line 77, in main
    check_cuda_lib(path, check_soname=args[i + 1] == "True")
  File "script.py", line 62, in check_cuda_lib
    output = subprocess.check_output([objdump, "-p", path]).decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 64: ordinal not in range(128)
ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': no such package '@local_config_cuda//cuda': Traceback (most recent call last):
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 1213
        _create_local_cuda_repository(<1 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 935, in _create_local_cuda_repository
        _find_libs(repository_ctx, <2 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 578, in _find_libs
        _check_cuda_libs(repository_ctx, <2 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 480, in _check_cuda_libs
        execute(repository_ctx, <1 more arguments>)
    File "/root/tensorflow/third_party/remote_config/common.bzl", line 209, in execute
        fail(<1 more arguments>)
Repository command failed
Traceback (most recent call last):
  File "script.py", line 88, in <module>
    main()
  File "script.py", line 77, in main
    check_cuda_lib(path, check_soname=args[i + 1] == "True")
  File "script.py", line 62, in check_cuda_lib
    output = subprocess.check_output([objdump, "-p", path]).decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 64: ordinal not in range(128)
WARNING: Target pattern parsing failed.
ERROR: no such package '@local_config_cuda//cuda': Traceback (most recent call last):
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 1213
        _create_local_cuda_repository(<1 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 935, in _create_local_cuda_repository
        _find_libs(repository_ctx, <2 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 578, in _find_libs
        _check_cuda_libs(repository_ctx, <2 more arguments>)
    File "/root/tensorflow/third_party/gpus/cuda_configure.bzl", line 480, in _check_cuda_libs
        execute(repository_ctx, <1 more arguments>)
    File "/root/tensorflow/third_party/remote_config/common.bzl", line 209, in execute
        fail(<1 more arguments>)
Repository command failed
Traceback (most recent call last):
  File "script.py", line 88, in <module>
    main()
  File "script.py", line 77, in main
    check_cuda_lib(path, check_soname=args[i + 1] == "True")
  File "script.py", line 62, in check_cuda_lib
    output = subprocess.check_output([objdump, "-p", path]).decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 64: ordinal not in range(128)

  File "script.py", line 62, in check_cuda_lib

script.py内容是动态生成的,执行如下内容(经过一点点的调试找到的):

/usr/local/python3_gpu_tf2/bin/python3 -c "from os import linesep;f = open('script.py', 'w');f.write('# Copyright 2020 The TensorFlow Authors. All Rights Reserved.' + linesep);f.write('#' + linesep);f.write('# Licensed under the Apache License, Version 2.0 (the \"License\");' + linesep);f.write('# you may not use this file except in compliance with the License.' + linesep);f.write('# You may obtain a copy of the License at' + linesep);f.write('#' + linesep);f.write('#     http://www.apache.org/licenses/LICENSE-2.0' + linesep);f.write('#' + linesep);f.write('# Unless required by applicable law or agreed to in writing, software' + linesep);f.write('# distributed under the License is distributed on an \"AS IS\" BASIS,' + linesep);f.write('# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.' + linesep);f.write('# See the License for the specific language governing permissions and' + linesep);f.write('# limitations under the License.' + linesep);f.write('# ==============================================================================' + linesep);f.write('\"\"\"Verifies that a list of libraries is installed on the system.' + linesep);f.write('' + linesep);f.write('Takes a a list of arguments with every two subsequent arguments being a logical' + linesep);f.write('tuple of (path, check_soname). The path to the library and either True or False' + linesep);f.write('to indicate whether to check the soname field on the shared library.' + linesep);f.write('' + linesep);f.write('Example Usage:' + linesep);f.write('./check_cuda_libs.py /path/to/lib1.so True /path/to/lib2.so False' + linesep);f.write('\"\"\"' + linesep);f.write('import os' + linesep);f.write('import os.path' + linesep);f.write('import platform' + linesep);f.write('import subprocess' + linesep);f.write('import sys' + linesep);f.write('' + linesep);f.write('# pylint: disable=g-import-not-at-top,g-importing-member' + linesep);f.write('try:' + linesep);f.write('  from shutil import which' + linesep);f.write('except ImportError:' + linesep);f.write('  from distutils.spawn import find_executable as which' + linesep);f.write('# pylint: enable=g-import-not-at-top,g-importing-member' + linesep);f.write('' + linesep);f.write('' + linesep);f.write('class ConfigError(Exception):' + linesep);f.write('  pass' + linesep);f.write('' + linesep);f.write('' + linesep);f.write('def _is_windows():' + linesep);f.write('  return platform.system() == \"Windows\"' + linesep);f.write('' + linesep);f.write('' + linesep);f.write('def check_cuda_lib(path, check_soname=True):' + linesep);f.write('  \"\"\"Tests if a library exists on disk and whether its soname matches the filename.' + linesep);f.write('' + linesep);f.write('  Args:' + linesep);f.write('    path: the path to the library.' + linesep);f.write('    check_soname: whether to check the soname as well.' + linesep);f.write('' + linesep);f.write('  Raises:' + linesep);f.write('    ConfigError: If the library does not exist or if its soname does not match' + linesep);f.write('    the filename.' + linesep);f.write('  \"\"\"' + linesep);f.write('  if not os.path.isfile(path):' + linesep);f.write('    raise ConfigError(\"No library found under: \" + path)' + linesep);f.write('  objdump = which(\"objdump\")' + linesep);f.write('  if check_soname and objdump is not None and not _is_windows():' + linesep);f.write('    # Decode is necessary as in py3 the return type changed from str to bytes' + linesep);
f.write('    print(\"========================\",objdump, path)'+ linesep);
f.write('    output = subprocess.check_output([objdump, \"-p\", path]).decode(\"ascii\")' + linesep);
f.write('    output = [line for line in output.splitlines() if \"SONAME\" in line]' + linesep);f.write('    sonames = [line.strip().split(\" \")[-1] for line in output]' + linesep);f.write('    if not any([soname == os.path.basename(path) for soname in sonames]):' + linesep);f.write('      raise ConfigError(\"None of the libraries match their SONAME: \" + path)' + linesep);f.write('' + linesep);f.write('' + linesep);f.write('def main():' + linesep);f.write('  try:' + linesep);f.write('    args = [argv for argv in sys.argv[1:]]' + linesep);f.write('    if len(args) % 2 == 1:' + linesep);f.write('      raise ConfigError(\"Expected even number of arguments\")' + linesep);f.write('    checked_paths = []' + linesep);f.write('    for i in range(0, len(args), 2):' + linesep);f.write('      path = args[i]' + linesep);f.write('      check_cuda_lib(path, check_soname=args[i + 1] == \"True\")' + linesep);f.write('      checked_paths.append(path)' + linesep);f.write('    # pylint: disable=superfluous-parens' + linesep);f.write('    print(os.linesep.join(checked_paths))' + linesep);f.write('    # pylint: enable=superfluous-parens' + linesep);f.write('  except ConfigError as e:' + linesep);f.write('    sys.stderr.write(str(e))' + linesep);f.write('    sys.exit(1)' + linesep);f.write('' + linesep);f.write('' + linesep);f.write('if __name__ == \"__main__\":' + linesep);f.write('  main()' + linesep);f.write('' + linesep);f.close();from os import system;system('/usr/local/python3_gpu_tf2/bin/python3 script.py \"/usr/local/cuda-10.2/targets/x86_64-linux/lib/stubs/libcuda.so\" None \"/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2\" True \"/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart_static.a\" False \"/usr/lib64/libcublas.so.10\" True \"/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcusolver.so.10\" True \"/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcurand.so.10\" True \"/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcufft.so.10\" True \"/usr/lib64/libcudnn.so.7\" True \"/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcupti.so.10.2\" True \"/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcusparse.so.10\" True');"

以上红色的行是调试加上去的,报错的是绿色的行。

问题出再.decode(\"ascii\")这里

这儿是执行一个shell命令【/usr/bin/objdump -p /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudart.so.10.2】的结果进行decode成ascii码,由于我系统的LANG=zh_CN.UTF-8因此输出如下图:

那,中文。。。。。哎。。。。。

解决方法:

执行如下命令,将环境变量设置成E文,重新编译即可。

export LANG=en_US

 

 

类型错误(由于我换gcc 版本导致的,解决方法:删掉~/.cache/bazel/_bazel_root 重新来过)

ERROR: /root/tensorflow/tensorflow/core/profiler/internal/gpu/BUILD:129:1: Couldn't build file tensorflow/core/profiler/internal/gpu/_objs/cupti_utils/cupti_utils.pic.o: C++ compilation of rule '//tensorflow/core/profiler/internal/gpu:cupti_utils' failed (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command 
  (cd /home/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow && \
  exec env - \
    LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64::/usr/local/cuda/extras/CUPTI/lib64 \
    PATH=/usr/local/cuda-10.1/bin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/root/bin:/home/app/hadoop/bin:/home/app/sprak/bin:/usr/local/maven/bin:/usr/local/hbase/bin:/usr/local/hive/bin:/usr/local/python3/bin:/usr/local/python3_gpu_tf2/bin \
    PWD=/proc/self/cwd \
  external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/host/bin/tensorflow/core/profiler/internal/gpu/_objs/cupti_utils/cupti_utils.pic.d '-frandom-seed=bazel-out/host/bin/tensorflow/core/profiler/internal/gpu/_objs/cupti_utils/cupti_utils.pic.o' -DEIGEN_MPL2_ONLY '-DEIGEN_MAX_ALIGN_BYTES=64' '-DEIGEN_HAS_TYPE_TRAITS=0' -D__CLANG_SUPPORT_DYN_ANNOTATION__ -iquote . -iquote bazel-out/host/bin -iquote external/com_google_absl -iquote bazel-out/host/bin/external/com_google_absl -iquote external/nsync -iquote bazel-out/host/bin/external/nsync -iquote external/eigen_archive -iquote bazel-out/host/bin/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/host/bin/external/local_config_sycl -iquote external/gif -iquote bazel-out/host/bin/external/gif -iquote external/libjpeg_turbo -iquote bazel-out/host/bin/external/libjpeg_turbo -iquote external/com_google_protobuf -iquote bazel-out/host/bin/external/com_google_protobuf -iquote external/com_googlesource_code_re2 -iquote bazel-out/host/bin/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/host/bin/external/farmhash_archive -iquote external/fft2d -iquote bazel-out/host/bin/external/fft2d -iquote external/highwayhash -iquote bazel-out/host/bin/external/highwayhash -iquote external/zlib -iquote bazel-out/host/bin/external/zlib -iquote external/local_config_cuda -iquote bazel-out/host/bin/external/local_config_cuda -iquote external/local_config_tensorrt -iquote bazel-out/host/bin/external/local_config_tensorrt -Ibazel-out/host/bin/external/local_config_cuda/cuda/_virtual_includes/cuda_headers_virtual -Ibazel-out/host/bin/external/local_config_cuda/cuda/_virtual_includes/cupti_headers_virtual -Ibazel-out/host/bin/external/local_config_tensorrt/_virtual_includes/tensorrt_headers -isystem external/nsync/public -isystem bazel-out/host/bin/external/nsync/public -isystem third_party/eigen3/mkl_include -isystem bazel-out/host/bin/third_party/eigen3/mkl_include -isystem external/eigen_archive -isystem bazel-out/host/bin/external/eigen_archive -isystem external/gif -isystem bazel-out/host/bin/external/gif -isystem external/com_google_protobuf/src -isystem bazel-out/host/bin/external/com_google_protobuf/src -isystem external/farmhash_archive/src -isystem bazel-out/host/bin/external/farmhash_archive/src -isystem external/zlib -isystem bazel-out/host/bin/external/zlib -isystem external/local_config_cuda/cuda -isystem bazel-out/host/bin/external/local_config_cuda/cuda -isystem external/local_config_cuda/cuda/cuda/include -isystem bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include -isystem external/local_config_cuda/cuda/cuda/extras/CUPTI/include -isystem bazel-out/host/bin/external/local_config_cuda/cuda/cuda/extras/CUPTI/include '-std=c++11' -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fPIC -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -fno-omit-frame-pointer -no-canonical-prefixes -fno-canonical-system-headers -DNDEBUG -g0 -O2 -ffunction-sections -fdata-sections -g0 -g0 '-std=c++14' -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare '-ftemplate-depth=900' -fno-exceptions '-DGOOGLE_CUDA=1' '-DTENSORFLOW_USE_NVCC=1' '-DTENSORFLOW_USE_XLA=1' '-DGOOGLE_TENSORRT=1' '-DINTEL_MKL=1' -DEIGEN_USE_VML -DENABLE_MKLDNN_V1 -DENABLE_MKL -msse3 -pthread '-DGOOGLE_CUDA=1' '-DTENSORFLOW_USE_XLA=1' '-DINTEL_MKL=1' -DENABLE_MKL '-DGOOGLE_TENSORRT=1' -c tensorflow/core/profiler/internal/gpu/cupti_utils.cc -o bazel-out/host/bin/tensorflow/core/profiler/internal/gpu/_objs/cupti_utils/cupti_utils.pic.o)
Execution platform: @local_config_platform//:host
In file included from bazel-out/host/bin/external/local_config_cuda/cuda/_virtual_includes/cupti_headers_virtual/third_party/gpus/cuda/extras/CUPTI/include/cupti.h:90:0,
                 from ./tensorflow/core/profiler/internal/gpu/cupti_interface.h:22,
                 from tensorflow/core/profiler/internal/gpu/cupti_utils.cc:16:
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_runtime_api_meta.h:1171:10: error: use of enum 'cudaGraphExecUpdateResult' without previous declaration
     enum cudaGraphExecUpdateResult *updateResult_out;
          ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from bazel-out/host/bin/external/local_config_cuda/cuda/_virtual_includes/cupti_headers_virtual/third_party/gpus/cuda/extras/CUPTI/include/cupti.h:91:0,
                 from ./tensorflow/core/profiler/internal/gpu/cupti_interface.h:22,
                 from tensorflow/core/profiler/internal/gpu/cupti_utils.cc:16:
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:673:5: error: 'CUmemGenericAllocationHandle' does not name a type
     CUmemGenericAllocationHandle *handle;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:675:11: error: 'CUmemAllocationProp' does not name a type
     const CUmemAllocationProp *prop;
           ^~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:680:5: error: 'CUmemGenericAllocationHandle' does not name a type
     CUmemGenericAllocationHandle handle;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:687:5: error: 'CUmemGenericAllocationHandle' does not name a type
     CUmemGenericAllocationHandle handle;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:699:11: error: 'CUmemAccessDesc' does not name a type
     const CUmemAccessDesc *desc;
           ^~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:705:11: error: 'CUmemLocation' does not name a type; did you mean 'CUjit_option'?
     const CUmemLocation *location;
           ^~~~~~~~~~~~~
           CUjit_option
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:711:5: error: 'CUmemGenericAllocationHandle' does not name a type
     CUmemGenericAllocationHandle handle;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:712:5: error: 'CUmemAllocationHandleType' does not name a type; did you mean 'CUexternalSemaphoreHandleType'?
     CUmemAllocationHandleType handleType;
     ^~~~~~~~~~~~~~~~~~~~~~~~~
     CUexternalSemaphoreHandleType
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:717:5: error: 'CUmemGenericAllocationHandle' does not name a type
     CUmemGenericAllocationHandle *handle;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:719:5: error: 'CUmemAllocationHandleType' does not name a type; did you mean 'CUexternalSemaphoreHandleType'?
     CUmemAllocationHandleType shHandleType;
     ^~~~~~~~~~~~~~~~~~~~~~~~~
     CUexternalSemaphoreHandleType
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:724:11: error: 'CUmemAllocationProp' does not name a type
     const CUmemAllocationProp *prop;
           ^~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:725:5: error: 'CUmemAllocationGranularity_flags' does not name a type; did you mean 'cuMemGetAllocationGranularity_params_st'?
     CUmemAllocationGranularity_flags option;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     cuMemGetAllocationGranularity_params_st
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:729:5: error: 'CUmemAllocationProp' does not name a type
     CUmemAllocationProp *prop;
     ^~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:730:5: error: 'CUmemGenericAllocationHandle' does not name a type
     CUmemGenericAllocationHandle handle;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/generated_cuda_meta.h:1308:5: error: 'CUgraphExecUpdateResult' does not name a type; did you mean 'CUgraphExec_st'?
     CUgraphExecUpdateResult *updateResult_out;
     ^~~~~~~~~~~~~~~~~~~~~~~
     CUgraphExec_st

 

 

 

编译器内部错误,解决方法升级gcc到7.5 试过4.8,6.4,7.0,7.3,7.4,7.5,最终7.5通过

 

注意显卡的驱动和支持的cuda的版本需要匹配,如下图(抬头cuda version):

都说安装cuda后默认安装驱动,其实不然,我还是需要单独安装的。

不要关心这个输出图中的最后一行,not supported,这个不影响使用。

最后贴上效果

>>> import tensorflow as tf
2020-05-11 21:41:56.248164: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
>>> print(tf.test.is_gpu_available())
WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2020-05-11 21:42:10.505997: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2394675000 Hz
2020-05-11 21:42:10.506416: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4331ca0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-05-11 21:42:10.506443: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-05-11 21:42:10.519928: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-05-11 21:42:10.615394: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-05-11 21:42:10.616834: I tensorflow/compiler/xla/service/platform_util.cc:139] StreamExecutor cuda device (0) is of insufficient compute capability: 3.5 required, device is 3.0
2020-05-11 21:42:10.616954: I tensorflow/compiler/jit/xla_gpu_device.cc:161] Ignoring visible XLA_GPU_JIT device. Device number is 0, reason: Internal: no supported devices found for platform CUDA
2020-05-11 21:42:10.617176: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-05-11 21:42:10.618081: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1544] Found device 0 with properties: 
pciBusID: 0000:01:00.0 name: GeForce GTX 870M computeCapability: 3.0
coreClock: 0.967GHz coreCount: 7 deviceMemorySize: 5.93GiB deviceMemoryBandwidth: 111.76GiB/s
2020-05-11 21:42:10.618143: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2020-05-11 21:42:10.651325: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2020-05-11 21:42:10.668405: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2020-05-11 21:42:10.672641: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2020-05-11 21:42:10.703298: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2020-05-11 21:42:10.709240: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2020-05-11 21:42:10.774991: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-05-11 21:42:10.775142: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-05-11 21:42:10.775851: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-05-11 21:42:10.776427: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1686] Adding visible gpu devices: 0
2020-05-11 21:42:10.776467: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2020-05-11 21:42:11.205974: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1085] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-05-11 21:42:11.206036: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1091]      0 
2020-05-11 21:42:11.206048: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1104] 0:   N 
2020-05-11 21:42:11.206260: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-05-11 21:42:11.206938: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:982] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-05-11 21:42:11.207582: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1230] Created TensorFlow device (/device:GPU:0 with 5598 MB memory) -> physical GPU (device: 0, name: GeForce GTX 870M, pci bus id: 0000:01:00.0, compute capability: 3.0)
True

>>> 

最后再提醒一次,一定要掌握科学上网,否则下载依赖包是劫。。。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值