Add a note to ignore dlerror for CPU-only pip package users when dynamically opening cudart fails.

PiperOrigin-RevId: 264940821
This commit is contained in:
Yifei Feng 2019-08-22 16:06:28 -07:00
parent bd96595653
commit 51bbebe1d6

View File

@ -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;