diff --git a/vdi/hip_device.cpp b/vdi/hip_device.cpp index cc27fef05e..80e247f37c 100644 --- a/vdi/hip_device.cpp +++ b/vdi/hip_device.cpp @@ -30,6 +30,10 @@ amd::HostQueue* Device::defaultStream() { defaultStream_ = new amd::HostQueue(*asContext(), *devices()[0], properties, amd::CommandQueue::RealTimeDisabled, amd::CommandQueue::Priority::Normal); + if ((defaultStream_ == nullptr) || + !defaultStream_->create()) { + return nullptr; + } } return defaultStream_; } diff --git a/vdi/hip_internal.hpp b/vdi/hip_internal.hpp index 03dcf0d51d..9b4bd17042 100755 --- a/vdi/hip_internal.hpp +++ b/vdi/hip_internal.hpp @@ -85,7 +85,7 @@ namespace hip { /// VDI context amd::Context* context_; /// VDI host queue for default streams - amd::HostQueue* defaultStream_; + amd::HostQueue* defaultStream_ = nullptr; /// Device's ID /// Store it here so we don't have to loop through the device list every time int deviceId_;