MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / InternalInit

Function InternalInit

tensorflow/stream_executor/cuda/cuda_driver.cc:270–286  ·  view source on GitHub ↗

Actually performs the work of CUDA initialization. Wrapped up in one-time execution guard.

Source from the content-addressed store, hash-verified

268// Actually performs the work of CUDA initialization. Wrapped up in one-time
269// execution guard.
270static port::Status InternalInit() {
271 CUresult res = CUDA_ERROR_NO_DEVICE;
272 if (FLAGS_gpuexec_cuda_driver_inject_init_error) {
273 LOG(ERROR) << "injecting CUDA init error; initialization will fail";
274 } else {
275 res = cuInit(0 /* = flags */);
276 }
277
278 if (res == CUDA_SUCCESS) {
279 return port::Status::OK();
280 }
281
282 LOG(ERROR) << "failed call to cuInit: " << ToString(res);
283 Diagnostician::LogDiagnosticInformation();
284 return port::Status(port::error::ABORTED,
285 absl::StrCat("failed call to cuInit: ", ToString(res)));
286}
287
288class CudaPrimaryContextsMgr {
289 public:

Callers 1

InitMethod · 0.70

Calls 3

ToStringFunction · 0.70
StatusEnum · 0.50
StrCatFunction · 0.50

Tested by

no test coverage detected