| 495 | MIOpenSupport::MIOpenSupport(GpuExecutor* parent) : parent_(parent) {} |
| 496 | |
| 497 | port::Status MIOpenSupport::Init() { |
| 498 | ScopedActivateExecutorContext context(parent_); |
| 499 | miopenHandle_t miopen_handle = nullptr; |
| 500 | auto status = wrap::miopenCreateWithStream( |
| 501 | reinterpret_cast<miopenHandle_t*>(&miopen_handle), (hipStream_t)(0)); |
| 502 | if (status == miopenStatusSuccess) { |
| 503 | miopen_.reset(new MIOpenAccess(miopen_handle)); |
| 504 | return port::Status::OK(); |
| 505 | } |
| 506 | |
| 507 | CHECK_EQ(miopen_handle, nullptr); |
| 508 | LOG(ERROR) << "could not create miopen handle: " << ToString(status); |
| 509 | if (status == miopenStatusNotInitialized) { |
| 510 | auto result = rocm::Diagnostician::FindKernelDriverVersion(); |
| 511 | if (!result.ok()) { |
| 512 | LOG(ERROR) << "error retrieving driver version: " |
| 513 | << rocm::DriverVersionStatusToString(result); |
| 514 | } else { |
| 515 | const auto& version = result.ValueOrDie(); |
| 516 | LOG(INFO) << "possibly insufficient driver version: " |
| 517 | << rocm::DriverVersionToString(version); |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | return port::Status{port::error::INTERNAL, |
| 522 | absl::StrCat("miopen library could not create a handle: ", |
| 523 | ToString(status))}; |
| 524 | } |
| 525 | |
| 526 | port::StatusOr<perftools::gputools::dnn::VersionInfo> |
| 527 | MIOpenSupport::GetVersion() { |
no test coverage detected