Repository navigation
Description
This is a regression problem, code was working fine 2 wks ago, did a git sync to the head and now I have this log message:
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcublas.so.7.0 locally
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcudnn.so.6.5 locally
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcufft.so.7.0 locally
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcuda.so locally
I tensorflow/stream_executor/dso_loader.cc:101] successfully opened CUDA library libcurand.so.7.0 locally
I tensorflow/core/common_runtime/gpu/gpu_init.cc:103] Found device 0 with properties:
name: GeForce GTX TITAN X
major: 5 minor: 2 memoryClockRate (GHz) 1.076
pciBusID 0000:02:00.0
Total memory: 12.00GiB
Free memory: 11.87GiB
I tensorflow/core/common_runtime/gpu/gpu_init.cc:127] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_init.cc:137] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:705] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX TITAN X, pci bus id: 0000:02:00.0)
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:42] Allocating 11.27GiB bytes.
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:52] GPU 0 memory begins at 0x2306c80000 extends to 0x25d8436a67
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 1.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 2.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 4.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 8.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 16.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 32.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 64.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 128.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 256.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 512.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 1.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 2.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 4.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 8.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 16.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 32.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 64.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 128.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 256.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 512.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 1.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 2.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 4.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 8.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:66] Creating bin of max chunk size 16.00GiB
create_encoder graph time 0.569116
create_decoder graph time 2.629546
create_loss graph time 0.960969
create_optimizer graph time 34.311540
F tensorflow/stream_executor/cuda/cuda_driver.cc:299] failed to query current context: CUDA_ERROR_DEINITIALIZED
F tensorflow/stream_executor/cuda/cuda_driver.cc:299] failed to query current context: CUDA_ERROR_DEINITIALIZED
F tensorflow/stream_executor/cuda/cuda_driver.cc:299] failed to query current context: CUDA_ERROR_DEINITIALIZED
F tensorflow/stream_executor/cuda/cuda_driver.cc:408] Check failed: CUDA_SUCCESS == dynload::cuCtxSetCurrent(prior_context_) (0 vs. 4)
Aborted (core dumped)
Note: (the create_*) is my code creating the graph.
The python code it crashes on is:
sess.run(tf.initialize_all_variables())
Activity
wchan commentedon Jan 7, 2016
here's the stack trace from gdb:
#2 0x00007fff52e11ad4 in tensorflow::internal::LogMessageFatal::~LogMessageFatal() () from /data-local/wchan/tensorflow_env/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.so
#3 0x00007fff52de0ff3 in perftools::gputools::cuda::(anonymous namespace)::CurrentContext() () from /data-local/wchan/tensorflow_env/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.so
#4 0x00007fff52de130c in perftools::gputools::cuda::ScopedActivateContext::ScopedActivateContext(CUctx_st, perftools::gputools::cuda::MultiOpActivation) ()
from /data-local/wchan/tensorflow_env/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.so
#5 0x00007fff52da145a in perftools::gputools::cuda::ScopedActivateExecutorContext::ScopedActivateExecutorContext(perftools::gputools::cuda::CUDAExecutor, perftools::gputools::cuda::MultiOpActivation) ()
from /data-local/wchan/tensorflow_env/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.so
#6 0x00007fff52c2e3e7 in tensorflow::BaseGPUDevice::Compute(tensorflow::OpKernel, tensorflow::OpKernelContext) () from /data-local/wchan/tensorflow_env/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
#7 0x00007fff52c4eac8 in tensorflow::(anonymous namespace)::ExecutorState::Process(tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, long long) ()
from /data-local/wchan/tensorflow_env/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
#8 0x00007fff52c43d20 in std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (tensorflow::(anonymous namespace)::ExecutorState::)(tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, long long)> (tensorflow::(anonymous namespace)::ExecutorState, tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, long long)> >::_M_invoke(std::_Any_data const&) ()
from /data-local/wchan/tensorflow_env/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
#9 0x00007fff52dff357 in tensorflow::thread::ThreadPool::WorkerLoop() () from /data-local/wchan/tensorflow_env/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
#10 0x00007ffff436ea40 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007ffff7bc4182 in start_thread (arg=0x7ffef87f8700) at pthread_create.c:312
#12 0x00007ffff78f147d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
skearnes commentedon Jan 7, 2016
+1
alexatknit commentedon Jan 7, 2016
I've got the same issue
vrv commentedon Jan 7, 2016
I have a suspicion that our mega-commit 1c57936 might have introduced a change that broke this (there are a bunch of changes that could be responsible, including changes to the stream executor and updating to a new version of Eigen, among other things).
It would be great if someone could confirm if it works at 2956250 but fails at the commit right after.
skearnes commentedon Jan 7, 2016
@vrv 2956250 works for me; 1c57936 does not.
vrv commentedon Jan 7, 2016
Cool, thanks for verifying. If you have time:
Revert the WORKSPACE file and eigen.BUILD changes (to use an earlier version of Eigen) and see if the problem goes away.
I'll dig into potential other issues in that commit.
skearnes commentedon Jan 7, 2016
Checking out WORKSPACE and eigen.BUILD from 2956250 does not fix the problem.
vrv commentedon Jan 7, 2016
Ok thanks, that helps.
vrv commentedon Jan 7, 2016
@zheng-xq, who independently was trying to debug this.
alexatknit commentedon Jan 7, 2016
I reverted to 2956250 and it seems to work, but the execution speed is cut in half
vrv commentedon Jan 7, 2016
Yup, that commit improved speed for some models, @zheng-xq is looking into what broke it.
zheng-xq commentedon Jan 8, 2016
I can confirm that with eigen-a0661a2bb165, an Eigen kernel fails to
launch. But with the older eigen-ce5a455b34c0, this problem goes away.
My reproducing command line:
bazel run -c opt --config=cuda
//tensorflow/models/image/alexnet:alexnet_benchmark
Passing to @benoitsteiner
On Thu, Jan 7, 2016 at 11:18 AM, Martin Wicke [email protected]
wrote:
vrv commentedon Jan 8, 2016
@zheng-xq: what eigen kernel failed, so we can figure out which kernel was the problem?
zheng-xq commentedon Jan 8, 2016
The kernel that was causing problem is:
EigenMetaKernel_Vectorizable<Eigen::TensorEvaluator<Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<float,
1, 1, int>, 16>,
Eigen::TensorCwiseUnaryOp<Eigen::internal::scalar_right<float, float,
Eigen::internal::scalar_product_op<float, float>, true>,
Eigen::TensorMap<Eigen::Tensor<float const, 1, 1, int>, 16> const> const>
const, Eigen::GpuDevice>, int>
It came from cwise_mul:
tensorflow::BinaryOp<Eigen::GpuDevice, tensorflow::functor::mul >
On Thu, Jan 7, 2016 at 6:53 PM, Vijay Vasudevan [email protected]
wrote:
benoitsteiner commentedon Jan 8, 2016
When running "bazel-bin/tensorflow/models/image/alexnet/alexnet_benchmark --benchmarks=all" on my machine, I get the following error:
external/re2/re2/regexp.cc:136: Bad reference count 65535
F tensorflow/stream_executor/cuda/cuda_driver.cc:408] Check failed: CUDA_SUCCESS == dynload::cuCtxSetCurrent(prior_context_) (0 vs. 4)
vrv commentedon Jan 9, 2016
Okay, we rolled back the change to switch to the newer version of Eigen, which apparently had some issues. 22267ad
So things should be now be working.
However, this uses an older version of Eigen that has some speed problems.
@benoitsteiner has upstreamed a newer fix to Eigen which should bring back the speed improvements and not crash things, so look for that soon.
Closing this for now, let us know if you still see problems.
jeremybarnes commentedon Jan 10, 2016
FWIW, I spent some time independently debugging this issue as well. What I found was that the preprocessor magic in Eigen was removing nvcc's ability to know what templated kernels to instantiate for the device code. The fix for the non-convolutional kernels was to modify the
eigen/unsupported/CXX11/src/tensor/TensorDeviceCuda.hfile and modify the LAUNCH_CUDA_KERNEL macro for the device code to force instantiation of the kernel.The full patch and details are in the Bitbucket pull request:
https://bitbucket.org/eigen/eigen/pull-requests/152/alternative-way-of-forcing-instantiation/diff
Upgraded to the latest version of Eigen, which fixes a compilation er…
Upgraded to the latest version of Eigen, which fixes a compilation er…
Upgraded to the latest version of Eigen, which fixes a compilation er…
Upgraded to the latest version of Eigen, which fixes a compilation er…
Upgraded to the latest version of Eigen, which fixes a compilation er…