How to install Tensorflow GPU with CUDA 10.0 for python on Windows

This is going to be a tutorial on how to install tensorflow 1.12 GPU version. We will also be installing CUDA 10.0 and cuDNN 7.3.1 along with the GPU version of tensorflow 1.12. At the time of writing this blog post, the latest version of tensorflow is 1.12. This tutorial is for building tensorflow from source. If you want to use the official pre-built pip package instead, I recommend another post, How to install Tensorflow using official pip package. If you are using Ubuntu instead of Windows, you may want to refer to our another article, How to install Tensorflow GPU with CUDA 10.0 for python on Ubuntu.  Tensorflow is an open source software library developed and used by Google that is fairly common among students, researchers, and developers for deep learning applications such as neural networks. It has both the CPU as well as GPU version available and although the CPU version works quite well, realistically, if you are going for deep learning, you will need GPU. In order to use the GPU version of TensorFlow, you will need an NVIDIA GPU with a compute capability > 3.0. Using latest version of Tensorflow provides you latest features and optimization, using latest CUDA Toolkit provides you speed improvement with latest gpu support and using latest CUDNN greatly improves deep learing training time. There must be 64-bit python installed tensorflow does not work on 32-bit python installation. Goto here for instruction on how to install python 3.6 on Windows. Also make sure python is set to %PATH% environment. Also make sure if you have enough ~ 15 GB of free space in C drive. You can use another drive as well but need to change path.

Step 1: Verify you have a CUDA-Capable GPU:

Before doing anything else, you need to verify that you have a CUDA-Capable GPU in order to install Tensorflow GPU. You can verify that you have a CUDA-capable GPU through the Display Adapters section in the Windows Device Manager. Here you will find the vendor name and model of your graphics card(s). The Windows Device Manager can be opened via the following steps: Open a run window from the Start Menu or (Win+R) Run:
control /name Microsoft.DeviceManager
Then goto Display Adapters. If your graphics card is from NVIDIA then go to http://developer.nvidia.com/cuda-gpus and verify if listed in CUDA enabled GPU list. Note down its Compute Capability. eg. GeForce 840M 5.0

Step 2: Install Visual C++ Build Tools 2015

We need Visual Studio 2015 stuffs here. If you have installed Visual Studio 2015 or 2017 no problem run the following setup and be okay with instructions on screen Goto https://visualstudio.microsoft.com/vs/older-downloads and move to end you will find “Redistributables and Build Tools” Download and install following :
1. Microsoft Visual C++ 2015 Redistributable Update 3 x64
2. Microsoft Build Tools 2015 Update 3

Step 3: Download the NVIDIA CUDA Toolkit:

If you have already CUDA stuffs other than CUDA 10 then uninstall all one by one from control panel. Go to https://developer.nvidia.com/cuda-downloads and download Installer for Windows [your version][network]. For me, version is Windows 10. I recommend you to use network installer. Install it in default location with default settings. It will update your GPU driver if required.

Step 4: Reboot the system to load the NVIDIA drivers.

Step 5: Check Cuda Toolkit:

Go to run (Win + R) type cmd The following command will check for nvcc version and insure that it is set in path environment variable.
nvcc --version
You will see something like:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018
Cuda compilation tools, release 10.0, V10.0.130
Now test a sample to see setup is working by running following Go to run (Win + R) type
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\demo_suite\nbody.exe"

Step 6: Install MSYS2:

MSYS2 provides you basic useful command-line Linux programs to your windows. Download http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe and install with all default settings Goto run [Win+R] and enter following command:
"C:\msys64\msys2_shell.cmd" -use-full-path
MSYS2 shell will opened update it using:
pacman -Syu
It will take some time to get updated if all completed then close the shell. Again goto run [Win+R] and enter following command:
"C:\msys64\msys2_shell.cmd" -use-full-path
MSYS2 shell will opened update it using:
pacman -Su

pacman -S git patch unzip zip ed
Complete all installation with [y]

Step 7: Install cuDNN 7.3.1:

Goto https://developer.nvidia.com/cudnn (Membership required) After login Download the following: cuDNN v7.3.1 Library for Windows [your version] for me Windows 10 Goto downloaded folder and extract cudnn-10.0-windows10-x64-v7.3.1.20.zip Go inside extracted folder and copy all files and folder from cuda folder (eg. Bin, include, lib) and paste to “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0”.

Step 8: Install bazel build:

Goto run [Win+R] and enter following command:
"C:\msys64\msys2_shell.cmd" -use-full-path
MSYS2 shell will opened, then do following:
cd /c/

mkdir bazel

cd bazel/

wget https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel-0.17.2-windows-x86_64.exe -O bazel.exe

Step 9: Set Windows to use long path :

Go to run (Win + R) enter following:
gpedit.msc
Then goto Computer Configuration -> Administrative Templates -> System -> Filesystem Configure “Enable Win32 long paths” to “Enabled”



9 Comments on How to install Tensorflow GPU with CUDA 10.0 for python on Windows

  1. it would be helpful if article covered how to link python with newly installed msys64. This part is currently skipped.
    Installed python separately but msys64 doesn’t see it. Tried to find a workaround using conda environment, but conda doesn’t see bazel to build TF. Vicious circle

    • export PATH=/c/:$PATH, in the tutorial msys2 uses all the path from windows so add python to windows environment path should work too.

  2. I had an error while building tensorflow using bazel.

    $ bazel build –config=opt –config=cuda //tensorflow/tools/pip_package:build_pip_package
    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.
    WARNING: Option ‘experimental_shortened_obj_file_path’ is deprecated
    Loading:
    Loading: 0 packages loaded
    Loading: 0 packages loaded
    currently loading: tensorflow/tools/pip_package
    DEBUG: C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:115:5:
    Auto-Configuration Warning: ‘BAZEL_VC’ is not set, start looking for the latest Visual C++ installed.
    DEBUG: C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:115:5:
    Auto-Configuration Warning: Looking for VS%VERSION%COMNTOOLS environment variables, eg. VS140COMNTOOLS
    DEBUG: C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:115:5:
    Auto-Configuration Warning: Looking for Visual C++ through registry
    DEBUG: C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:115:5:
    Auto-Configuration Warning: Looking for default Visual C++ installation directory
    DEBUG: C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:115:5:
    Auto-Configuration Warning: ‘PROGRAMFILES(X86)’ environment variable is not set, using ‘C:\Program Files (x86)’ as default
    ERROR: Skipping ‘//tensorflow/tools/pip_package:build_pip_package’: error loading package ‘tensorflow/tools/pip_package’: Encountered error while reading extension file ‘cuda/build_defs.bzl’: no such package ‘@local_config_cuda//cuda’: Traceback (most recent call last):
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 1447
    _create_local_cuda_repository(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 1303, in _create_local_cuda_repository
    find_cc(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 217, in find_cc
    _get_msvc_compiler(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 153, in _get_msvc_compiler
    find_msvc_tool(repository_ctx, vc_path, “cl.exe”)
    File “C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/windows_cc_configure.bzl”, line 217, in find_msvc_tool
    _is_vs_2017(vc_path)
    File “C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/windows_cc_configure.bzl”, line 177, in _is_vs_2017
    vc_path.find(“2017”)
    type ‘NoneType’ has no method find(string)
    WARNING: Target pattern parsing failed.
    Analyzing: 0 targets (0 packages loaded)
    ERROR: error loading package ‘tensorflow/tools/pip_package’: Encountered error while reading extension file ‘cuda/build_defs.bzl’: no such package ‘@local_config_cuda//cuda’: Traceback (most recent call last):
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 1447
    _create_local_cuda_repository(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 1303, in _create_local_cuda_repository
    find_cc(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 217, in find_cc
    _get_msvc_compiler(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 153, in _get_msvc_compiler
    find_msvc_tool(repository_ctx, vc_path, “cl.exe”)
    File “C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/windows_cc_configure.bzl”, line 217, in find_msvc_tool
    _is_vs_2017(vc_path)
    File “C:/users/moura/_bazel_moura/wvk7snnt/external/bazel_tools/tools/cpp/windows_cc_configure.bzl”, line 177, in _is_vs_2017
    vc_path.find(“2017”)
    type ‘NoneType’ has no method find(string)
    INFO: Elapsed time: 4.581s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (0 packages loaded)
    FAILED: Build did NOT complete successfully (0 packages loaded)

      • 1.12 same as the tutorial
        however now I have a new problem
        $ bazel build –config=opt –config=cuda //tensorflow/tools/pip_package:build_pip_package
        Starting local Bazel server and connecting to it…
        Server crashed during startup. Now printing c:\users\moura\_bazel_moura\wvk7snnt/server/jvm.out
        WARNING: An illegal reflective access operation has occurred
        WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/C:/Users/moura/_bazel_moura/install/3a7287a15200b68eb8146fc168635be1/_embedded_binaries/A-server.jar) to field java.lang.String.value
        WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
        WARNING: Use –illegal-access=warn to enable warnings of further illegal reflective access operations
        WARNING: All illegal access operations will be denied in a future release
        java.lang.IllegalStateException: failed to create a child event loop
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:88)
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:58)
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:47)
        at io.netty.channel.MultithreadEventLoopGroup.(MultithreadEventLoopGroup.java:59)
        at io.netty.channel.nio.NioEventLoopGroup.(NioEventLoopGroup.java:77)
        at io.netty.channel.nio.NioEventLoopGroup.(NioEventLoopGroup.java:72)
        at io.netty.channel.nio.NioEventLoopGroup.(NioEventLoopGroup.java:59)
        at io.grpc.netty.Utils$DefaultEventLoopGroupResource.create(Utils.java:190)
        at io.grpc.netty.Utils$DefaultEventLoopGroupResource.create(Utils.java:174)
        at io.grpc.internal.SharedResourceHolder.getInternal(SharedResourceHolder.java:104)
        at io.grpc.internal.SharedResourceHolder.get(SharedResourceHolder.java:74)
        at io.grpc.netty.NettyServer.allocateSharedGroups(NettyServer.java:258)
        at io.grpc.netty.NettyServer.start(NettyServer.java:138)
        at io.grpc.internal.ServerImpl.start(ServerImpl.java:149)
        at io.grpc.internal.ServerImpl.start(ServerImpl.java:73)
        at com.google.devtools.build.lib.server.GrpcServerImpl.serve(GrpcServerImpl.java:717)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.serverMain(BlazeRuntime.java:948)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.main(BlazeRuntime.java:652)
        at com.google.devtools.build.lib.bazel.Bazel.main(Bazel.java:68)
        Caused by: io.netty.channel.ChannelException: failed to open a new selector
        at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:175)
        at io.netty.channel.nio.NioEventLoop.(NioEventLoop.java:149)
        at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:127)
        at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:36)
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:84)
        … 18 more
        Caused by: java.io.IOException: Unable to establish loopback connection
        at java.base/sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
        at java.base/sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/sun.nio.ch.PipeImpl.(Unknown Source)
        at java.base/sun.nio.ch.SelectorProviderImpl.openPipe(Unknown Source)
        at java.base/java.nio.channels.Pipe.open(Unknown Source)
        at java.base/sun.nio.ch.WindowsSelectorImpl.(Unknown Source)
        at java.base/sun.nio.ch.WindowsSelectorProvider.openSelector(Unknown Source)
        at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:173)
        … 22 more
        Caused by: java.net.BindException: Cannot assign requested address: connect
        at java.base/sun.nio.ch.Net.connect0(Native Method)
        at java.base/sun.nio.ch.Net.connect(Unknown Source)
        at java.base/sun.nio.ch.Net.connect(Unknown Source)
        at java.base/sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
        at java.base/java.nio.channels.SocketChannel.open(Unknown Source)
        at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(Unknown Source)
        … 31 more

  3. Im at step 11 at this command:

    python configure.py

    Im getting ‘bash: python: command not found’
    im using anaconda by the way if it makes any difference

  4. Got this error while installing

    ERROR: C:/users/lb/_bazel_lb/wvk7snnt/external/jpeg/BUILD.bazel:401:1: Executing genrule @jpeg//:simd_win_x86_64_assemble failed (Illegal instruction): bash.exe failed: error executing command
    cd C:/users/lb/_bazel_lb/wvk7snnt/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 PATH=C:\msys64\usr\bin;C:\msys64\bin;C:\bazel;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\usr\bin;C:\msys64\opt\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\Program Files\Microsoft MPI\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files\Microsoft SQL Server\140\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Microsoft VS Code\bin;C:\Users\LB\AppData\Local\Programs\Python\Python36\Scripts;C:\Users\LB\AppData\Local\Programs\Python\Python36;C:\Users\LB\AppData\Local\Microsoft\WindowsApps;C:\Users\LB\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\LB\AppData\Roaming\npm;C:\Users\LB\AppData\Local\Programs\Microsoft VS Code Insiders\bin;C:\Program Files\JetBrains\PyCharm 2018.3.2\bin;C:\msys64\usr\bin\site_perl;C:\msys64\usr\bin\vendor_perl;C:\msys64\usr\bin\core_perl
    SET PYTHON_BIN_PATH=C:/Users/LB/AppData/Local/Programs/Python/Python36/python.exe
    SET PYTHON_LIB_PATH=C:/Users/LB/AppData/Local/Programs/Python/Python36/lib/site-packages
    SET TF_CUDA_CLANG=0
    SET TF_CUDA_COMPUTE_CAPABILITIES=5.0
    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
    C:/msys64/usr/bin/bash.exe -c source external/bazel_tools/tools/genrule/genrule-setup.sh; for out in bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jccolor-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jccolor-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcgray-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcgray-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jchuff-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcphuff-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcsample-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcsample-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdcolor-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdcolor-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdmerge-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdmerge-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdsample-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdsample-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jfdctflt-sse.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jfdctfst-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jfdctint-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jfdctint-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctflt-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctfst-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctint-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctint-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctred-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jquantf-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jquanti-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jquanti-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jsimdcpu.obj; do
    bazel-out/x64_windows-opt/bin/external/nasm/nasm -fwin64 -DWIN64 -D__x86_64__ -I $(dirname external/jpeg/simd/x86_64/jccolext-sse2.asm)/ -I $(dirname external/jpeg/simd/nasm/jdct.inc)/ -I $(dirname external/jpeg/simd/nasm/jdct.inc)/../../win/ -o $out $(dirname external/jpeg/simd/x86_64/jccolext-sse2.asm)/$(basename ${out%.obj}.asm)
    done: bash.exe failed: error executing command
    cd C:/users/lb/_bazel_lb/wvk7snnt/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 PATH=C:\msys64\usr\bin;C:\msys64\bin;C:\bazel;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\usr\bin;C:\msys64\opt\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\Program Files\Microsoft MPI\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files\Microsoft SQL Server\140\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Microsoft VS Code\bin;C:\Users\LB\AppData\Local\Programs\Python\Python36\Scripts;C:\Users\LB\AppData\Local\Programs\Python\Python36;C:\Users\LB\AppData\Local\Microsoft\WindowsApps;C:\Users\LB\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\LB\AppData\Roaming\npm;C:\Users\LB\AppData\Local\Programs\Microsoft VS Code Insiders\bin;C:\Program Files\JetBrains\PyCharm 2018.3.2\bin;C:\msys64\usr\bin\site_perl;C:\msys64\usr\bin\vendor_perl;C:\msys64\usr\bin\core_perl
    SET PYTHON_BIN_PATH=C:/Users/LB/AppData/Local/Programs/Python/Python36/python.exe
    SET PYTHON_LIB_PATH=C:/Users/LB/AppData/Local/Programs/Python/Python36/lib/site-packages
    SET TF_CUDA_CLANG=0
    SET TF_CUDA_COMPUTE_CAPABILITIES=5.0
    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
    C:/msys64/usr/bin/bash.exe -c source external/bazel_tools/tools/genrule/genrule-setup.sh; for out in bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jccolor-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jccolor-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcgray-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcgray-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jchuff-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcphuff-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcsample-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jcsample-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdcolor-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdcolor-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdmerge-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdmerge-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdsample-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jdsample-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jfdctflt-sse.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jfdctfst-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jfdctint-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jfdctint-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctflt-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctfst-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctint-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctint-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jidctred-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jquantf-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jquanti-avx2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jquanti-sse2.obj bazel-out/x64_windows-opt/genfiles/external/jpeg/simd/x86_64/jsimdcpu.obj; do
    bazel-out/x64_windows-opt/bin/external/nasm/nasm -fwin64 -DWIN64 -D__x86_64__ -I $(dirname external/jpeg/simd/x86_64/jccolext-sse2.asm)/ -I $(dirname external/jpeg/simd/nasm/jdct.inc)/ -I $(dirname external/jpeg/simd/nasm/jdct.inc)/../../win/ -o $out $(dirname external/jpeg/simd/x86_64/jccolext-sse2.asm)/$(basename ${out%.obj}.asm)
    done
    /usr/bin/bash: line 1: 1896 Illegal instruction bazel-out/x64_windows-opt/bin/external/nasm/nasm -fwin64 -DWIN64 -D__x86_64__ -I $(dirname external/jpeg/simd/x86_64/jccolext-sse2.asm)/ -I $(dirname external/jpeg/simd/nasm/jdct.inc)/ -I $(dirname external/jpeg/simd/nasm/jdct.inc)/../../win/ -o $out $(dirname external/jpeg/simd/x86_64/jccolext-sse2.asm)/$(basename ${out%.obj}.asm)
    Target //tensorflow/tools/pip_package:build_pip_package failed to build
    INFO: Elapsed time: 713.407s, Critical Path: 172.97s
    INFO: 192 processes: 192 local.
    FAILED: Build did NOT complete successfully
    FAILED: Build did NOT complete successfully

  5. HAVING PROBLEM IN STEP 12
    WARNING: The following configs were expanded more than once: [cuda, monolithic]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
    WARNING: Option ‘experimental_shortened_obj_file_path’ is deprecated
    Loading:
    Loading: 0 packages loaded
    ERROR: Skipping ‘//tensorflow/tools/pip_package:build_pip_package’: error loading package ‘tensorflow/tools/pip_package’: Encountered error while reading extension file ‘cuda/build_defs.bzl’: no such package ‘@local_config_cuda//cuda’: Traceback (most recent call last):
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 1447
    _create_local_cuda_repository(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 1187, in _create_local_cuda_repository
    _get_cuda_config(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 911, in _get_cuda_config
    _cudnn_version(repository_ctx, cudnn_install_base…, …)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 614, in _cudnn_version
    auto_configure_fail((“cuDNN version detected from %s…)))
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 317, in auto_configure_fail
    fail((“\n%sCuda Configuration Error:%…)))

    Cuda Configuration Error: cuDNN version detected from C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/include/cudnn.h (7.3.1) does not match TF_CUDNN_VERSION (7)
    WARNING: Target pattern parsing failed.
    ERROR: error loading package ‘tensorflow/tools/pip_package’: Encountered error while reading extension file ‘cuda/build_defs.bzl’: no such package ‘@local_config_cuda//cuda’: Traceback (most recent call last):
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 1447
    _create_local_cuda_repository(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 1187, in _create_local_cuda_repository
    _get_cuda_config(repository_ctx)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 911, in _get_cuda_config
    _cudnn_version(repository_ctx, cudnn_install_base…, …)
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 614, in _cudnn_version
    auto_configure_fail((“cuDNN version detected from %s…)))
    File “C:/tensorflow/tensorflow/third_party/gpus/cuda_configure.bzl”, line 317, in auto_configure_fail
    fail((“\n%sCuda Configuration Error:%…)))

    Cuda Configuration Error: cuDNN version detected from C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/include/cudnn.h (7.3.1) does not match TF_CUDNN_VERSION (7)
    INFO: Elapsed time: 0.245s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (0 packages loaded)
    FAILED: Build did NOT complete successfully (0 packages loaded)

Leave a Reply

Your email address will not be published.




This site uses Akismet to reduce spam. Learn how your comment data is processed.