nvcc error : 'cicc' died with status 0xC0000005 (ACCESS_VIOLATION) when building tensorflow with bazel


I am trying to build Tensorflow 1.14.0 dll. I am using bazel 0.24.1 to do it. I also use cuDNN 7.1.4 and CUDA 9.0.I want it to use Visual C++ Build Tools 2015, but when running bazel to build dll:

bazel build --config=cuda tensorflow:tensorflow.dll,

by default in LIB and INCLUDE variables path C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023 is set. I then get bunch of errors like C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\xutility(796): error: expression must have a constant value. Build failes with error: nvcc error : 'cicc' died with status 0xC0000005 (ACCESS_VIOLATION).

I tried to set:

set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0
set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC

but error still occurs. Any ideas?

asked on Stack Overflow Dec 18, 2019 by Biba

1 Answer


I finally got a solution. You can force correct paths by setting following environment variables:

CPU_COMPILER = ('C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe') GCC_HOST_COMPILER_PATH = ('C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe')

just before running

bazel build --config=cuda tensorflow:tensorflow.dll

in commandline. It's best to do it in Powershell, as there is a problem with spaces/apostrophes in paths when using Windows commandline.

answered on Stack Overflow Dec 23, 2019 by Biba

User contributions licensed under CC BY-SA 3.0