tensorflow-windows-build-script icon indicating copy to clipboard operation
tensorflow-windows-build-script copied to clipboard

build error cuda.....

Open AiIsBetter opened this issue 5 years ago • 8 comments

PS C:\WINDOWS\system32> d: PS D:> cd D:\CPlus\tensorflow\tensorflow-windows-build-script-master PS D:\CPlus\tensorflow\tensorflow-windows-build-script-master> $parameterString = "-c opt --config=cuda --define=no_tens orflow_py_deps=true --copt=-nvcc_options=disable-warnings //tensorflow:libtensorflow_cc.so --verbose_failures"

.\build.ps1 -BazelBuildParameters $parameterString -BuildCppAPI -ReserveSource -ReserveVenv

Select a Tensorflow version: [1] 1 - v1.13.1 [2] 2 - v1.12.0 [3] 3 - v1.11.0 [S] Select another version [?] 帮助 (默认值为“1”): 2 Found chocolatey installed. Unable to find pacman. Which version would you like to install? [Default version: 20180531.0.0]: Chocolatey v0.10.13 Installing the following packages: msys2 By installing you accept licenses for the packages. msys2 v20180531.0.0 already installed. Use --force to reinstall, specify a version to install, or try upgrade.

Chocolatey installed 0/1 packages. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Warnings:

  • msys2 - msys2 v20180531.0.0 already installed. Use --force to reinstall, specify a version to install, or try upgrade. Found patch installed. Found unzip installed. Found bazel installed. Make sure you have installed same version of bazel 0.15.0. Are you sure you want to PROCEED? [y/n]: y Found git installed. Found python installed. Make sure you have installed same version of python 3.6.7. Are you sure you want to PROCEED? [y/n]: y Checking out files: 100% (13330/13330), done. HEAD is now at a5c2e20205 [TF:XLA] Support broadcasting in the lowering of SoftmaxCrossEntropyWithLogits. Switched to branch 'master' Your branch is up to date with 'origin/master'. Already up to date. Checking out files: 100% (13330/13330), done. Note: checking out 'tags/v1.12.0'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at a6d8ffae09 Fix a bug in tpu.py and xla.py that while creating an identity node for control input edges under rewrite context, the parent control flow context is lost. (#23446) Removing .tf_configure.bazelrc Removing tensorflow/tf_exported_symbols_msvc.lds Removing third_party/eigen_half.patch Removing tools/python_bin_path.sh warning: tensorflow/workspace.bzl has type 100644, expected 100755 Starting local Bazel server and connecting to it... ................. INFO: Starting clean. WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown". You have bazel 0.15.0 installed. Do you wish to build TensorFlow with Apache Ignite support? [Y/n]: y Apache Ignite support will be enabled for TensorFlow.

Do you wish to build TensorFlow with XLA JIT support? [y/N]: n No XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with ROCm support? [y/N]: n No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: y CUDA support will be enabled for TensorFlow.

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

Please specify the location where CUDA 10.0 toolkit is installed. Refer to README.md for more details. [Default is C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0]:

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

Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0]:

Please specify a list of comma-separated Cuda compute capabilities you want to build with. You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 3.5,7.0]: 6.1

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is /arch:AVX]: /arch:AVX2

Would you like to override eigen strong inline for some C++ compilation to reduce the compilation time? [Y/n]: Y Eigen strong inline overridden.

Starting local Bazel server and connecting to it... ................. WARNING: The following configs were expanded more than once: [cuda]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior. ERROR: Skipping '//tensorflow:libtensorflow_cc.so': error loading package 'tensorflow': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': C:/users/z&j/_bazel_z&j/o66lyhoe/external/local_config_cuda/cuda (Directory not empty) WARNING: Target pattern parsing failed. ERROR: error loading package 'tensorflow': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': C:/users/z&j/_bazel_z&j/o66lyhoe/external/local_config_cuda/cuda (Directory not empty) INFO: Elapsed time: 14.295s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded) currently loading: tensorflow (venv) PS D:\CPlus\tensorflow\tensorflow-windows-build-script-master>

Always encounter this problem, which setting error ?Or this is a bug

vs2015 cuda10.0 cudnn7.3.1 win10,gtx1060,bazel 0.15...tf1.12.0

AiIsBetter avatar May 26 '19 02:05 AiIsBetter

This is a Tensorflow-related issue which is not related to the script. You should search the workaround with this bazel output in some Tensorflow areas. Sorry that I am unable to help you.

terryzhao127 avatar May 26 '19 04:05 terryzhao127

Thanks for your reply. I encountered this problem again later. I wish you could give me some advice on this。I deleted that local config cuda folder. ERROR: D:/cplus/tensorflow/tensorflow-windows-build-script-master/source/tensorflow/core/kernels/BUILD:1918:1: C++ compilation of rule '//tensorflow/core/kernels:eye_functor_gpu' failed (Exit 1): msvc_wrapper_for_nvcc.bat failed: error executing command cd C:/users/z&j/bazel_z&j/o66lyhoe/execroot/org_tensorflow SET CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0 SET CUDNN_INSTALL_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0 SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt; SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64; SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64;;C:\WINDOWS\system32 SET PWD=/proc/self/cwd SET PYTHON_BIN_PATH=D:/CPlus/tensorflow/tensorflow-windows-build-script-master/venv/Scripts/python.exe SET PYTHON_LIB_PATH=D:/CPlus/tensorflow/tensorflow-windows-build-script-master/venv/lib/site-packages SET TEMP=C:\Users\Z&J\AppData\Local\Temp SET TF_CUDA_CLANG=0 SET TF_CUDA_COMPUTE_CAPABILITIES=6.1 SET TF_CUDA_VERSION=10.0 SET TF_CUDNN_VERSION=7 SET TF_NEED_CUDA=1 SET TF_NEED_OPENCL_SYCL=0 SET TF_NEED_ROCM=0 SET TMP=C:\Users\Z&J\AppData\Local\Temp external/local_config_cuda/crosstool/windows/msvc_wrapper_for_nvcc.bat /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS /bigobj /Zm500 /J /Gy /GF /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /I. /Ibazel-out/x64_windows-opt/genfiles /Iexternal/com_google_absl /Ibazel-out/x64_windows-opt/genfiles/external/com_google_absl /Iexternal/bazel_tools /Ibazel-out/x64_windows-opt/genfiles/external/bazel_tools /Iexternal/eigen_archive /Ibazel-out/x64_windows-opt/genfiles/external/eigen_archive /Iexternal/local_config_sycl /Ibazel-out/x64_windows-opt/genfiles/external/local_config_sycl /Iexternal/nsync /Ibazel-out/x64_windows-opt/genfiles/external/nsync /Iexternal/gif_archive /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive /Iexternal/jpeg /Ibazel-out/x64_windows-opt/genfiles/external/jpeg /Iexternal/protobuf_archive /Ibazel-out/x64_windows-opt/genfiles/external/protobuf_archive /Iexternal/com_googlesource_code_re2 /Ibazel-out/x64_windows-opt/genfiles/external/com_googlesource_code_re2 /Iexternal/farmhash_archive /Ibazel-out/x64_windows-opt/genfiles/external/farmhash_archive /Iexternal/fft2d /Ibazel-out/x64_windows-opt/genfiles/external/fft2d /Iexternal/highwayhash /Ibazel-out/x64_windows-opt/genfiles/external/highwayhash /Iexternal/zlib_archive /Ibazel-out/x64_windows-opt/genfiles/external/zlib_archive /Iexternal/double_conversion /Ibazel-out/x64_windows-opt/genfiles/external/double_conversion /Iexternal/snappy /Ibazel-out/x64_windows-opt/genfiles/external/snappy /Iexternal/local_config_cuda /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda /Iexternal/eigen_archive /Ibazel-out/x64_windows-opt/genfiles/external/eigen_archive /Ibazel-out/x64_windows-opt/bin/external/eigen_archive /Iexternal/nsync/public /Ibazel-out/x64_windows-opt/genfiles/external/nsync/public /Ibazel-out/x64_windows-opt/bin/external/nsync/public /Iexternal/gif_archive/lib /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive/lib /Ibazel-out/x64_windows-opt/bin/external/gif_archive/lib /Iexternal/gif_archive/windows /Ibazel-out/x64_windows-opt/genfiles/external/gif_archive/windows /Ibazel-out/x64_windows-opt/bin/external/gif_archive/windows /Iexternal/protobuf_archive/src /Ibazel-out/x64_windows-opt/genfiles/external/protobuf_archive/src /Ibazel-out/x64_windows-opt/bin/external/protobuf_archive/src /Iexternal/farmhash_archive/src /Ibazel-out/x64_windows-opt/genfiles/external/farmhash_archive/src /Ibazel-out/x64_windows-opt/bin/external/farmhash_archive/src /Iexternal/zlib_archive /Ibazel-out/x64_windows-opt/genfiles/external/zlib_archive /Ibazel-out/x64_windows-opt/bin/external/zlib_archive /Iexternal/double_conversion /Ibazel-out/x64_windows-opt/genfiles/external/double_conversion /Ibazel-out/x64_windows-opt/bin/external/double_conversion /Iexternal/local_config_cuda/cuda /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda /Iexternal/local_config_cuda/cuda/cuda/include /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda/cuda/include /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/cuda/include /Iexternal/local_config_cuda/cuda/cuda/include/crt /Ibazel-out/x64_windows-opt/genfiles/external/local_config_cuda/cuda/cuda/include/crt /Ibazel-out/x64_windows-opt/bin/external/local_config_cuda/cuda/cuda/include/crt /D__CLANG_SUPPORT_DYN_ANNOTATION_ /DEIGEN_MPL2_ONLY /DEIGEN_MAX_ALIGN_BYTES=64 /DTF_USE_SNAPPY /showIncludes /MD /O2 /DNDEBUG -w -nvcc_options=disable-warnings -DGOOGLE_CUDA=1 -DTENSORFLOW_MONOLITHIC_BUILD /DPLATFORM_WINDOWS /DEIGEN_HAS_C99_MATH /DTENSORFLOW_USE_EIGEN_THREADPOOL /DEIGEN_AVOID_STL_ARRAY /Iexternal/gemmlowp /wd4018 /wd4577 /DNOGDI /DTF_COMPILE_LIBRARY -x cuda -DGOOGLE_CUDA=1 -nvcc_options=relaxed-constexpr -nvcc_options=ftz=true /Fobazel-out/x64_windows-opt/bin/tensorflow/core/kernels/_objs/eye_functor_gpu/eye_functor_gpu.cu.o /c tensorflow/core/kernels/eye_functor_gpu.cu.cc nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/amd64/../../../VC/bin/amd64/vcvars64.bat'

AiIsBetter avatar May 26 '19 07:05 AiIsBetter

@guikarist Thank you for this, can you provide the dll and lib to us , it's hard to compile, always error and error....? Please~~

ZLeopard avatar May 28 '19 08:05 ZLeopard

@ZLeopard I am sorry it is very specific to your usage. If you have to use some symbols that was not compiled into, it would fail again when you use it.

terryzhao127 avatar May 28 '19 08:05 terryzhao127

@ZLeopard Tried this already? https://devtalk.nvidia.com/default/topic/884199/could-not-set-up-environment-vcvars64-bat-/

https://support.microsoft.com/en-us/help/2524009/error-running-command-shell-scripts-that-include-parentheses

StevenRoodhorst avatar May 28 '19 09:05 StevenRoodhorst

@ZLeopard Tried this already? https://devtalk.nvidia.com/default/topic/884199/could-not-set-up-environment-vcvars64-bat-/

https://support.microsoft.com/en-us/help/2524009/error-running-command-shell-scripts-that-include-parentheses

I have set the environment variables as mentioned above, such as vsinstall. I also modified vcvars64.bat. But I don't know if I have corrected it correctly.If so, could you tell me how to modify it?thanks a lot.~

AiIsBetter avatar May 28 '19 11:05 AiIsBetter

Is the filepath correct? C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/amd64/../../../VC/bin/amd64/vcvars64.bat

StevenRoodhorst avatar May 29 '19 07:05 StevenRoodhorst

Is the filepath correct? C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/amd64/../../../VC/bin/amd64/vcvars64.bat

This is the full path:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat But it feels a little strange to report the wrong path, and I don't know where to modify it. The default path loads doesn't seem to be right.

AiIsBetter avatar May 29 '19 09:05 AiIsBetter