From 51bbebe1d680c78224bafc18fcd94c6827017ce0 Mon Sep 17 00:00:00 2001 From: Yifei Feng Date: Thu, 22 Aug 2019 16:06:28 -0700 Subject: [PATCH] Add a note to ignore dlerror for CPU-only pip package users when dynamically opening cudart fails. PiperOrigin-RevId: 264940821 --- tensorflow/stream_executor/cuda/cudart_stub.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tensorflow/stream_executor/cuda/cudart_stub.cc b/tensorflow/stream_executor/cuda/cudart_stub.cc index acdf34e373f..0c6b274f88b 100644 --- a/tensorflow/stream_executor/cuda/cudart_stub.cc +++ b/tensorflow/stream_executor/cuda/cudart_stub.cc @@ -25,7 +25,11 @@ void* GetDsoHandle() { static auto handle = []() -> void* { auto handle_or = stream_executor::internal::DsoLoader::GetCudaRuntimeDsoHandle(); - if (!handle_or.ok()) return nullptr; + if (!handle_or.ok()) { + LOG(INFO) << "Ignore above cudart dlerror if you do not have a GPU set " + "up on your machine."; + return nullptr; + } return handle_or.ValueOrDie(); }(); return handle;