diff --git a/projects/clr/rocclr/device/pal/paldevice.cpp b/projects/clr/rocclr/device/pal/paldevice.cpp index c0fe12595e..d8e38f55dd 100644 --- a/projects/clr/rocclr/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/device/pal/paldevice.cpp @@ -57,6 +57,14 @@ #include #include +#ifdef PAL_GPUOPEN_OCL +// gpuutil headers +#include "gpuUtil/palGpaSession.h" +#include "devDriverServer.h" +#include "protocols/rgpServer.h" +#include "protocols/driverControlServer.h" +#endif // PAL_GPUOPEN_OCL + namespace { //! Define the mapping from PAL asic revision enumeration values to the @@ -1289,6 +1297,16 @@ bool Device::init() { return false; } +#ifdef PAL_GPUOPEN_OCL + if ((platform_->GetDevDriverServer() != nullptr) && + (platform_->GetDevDriverServer()->GetDriverControlServer() != nullptr)) { + // Make sure the devdriver initialization is done after Pal platform creation + // to avoid a timeout in RGP server + platform_->GetDevDriverServer()->GetDriverControlServer()->StartLateDeviceInit(); + platform_->GetDevDriverServer()->GetDriverControlServer()->FinishDeviceInit(); + } +#endif // PAL_GPUOPEN_OCL + // Get the total number of active devices // Count up all the devices in the system. platform_->EnumerateDevices(&gNumDevices, &gDeviceList[0]); diff --git a/projects/clr/rocclr/device/pal/palgpuopen.cpp b/projects/clr/rocclr/device/pal/palgpuopen.cpp index 3187782674..f473bc2dbd 100644 --- a/projects/clr/rocclr/device/pal/palgpuopen.cpp +++ b/projects/clr/rocclr/device/pal/palgpuopen.cpp @@ -245,8 +245,6 @@ void RgpCaptureMgr::Finalize() { rgp_server_->DisableTraces(); } - dev_driver_server_->GetDriverControlServer()->StartLateDeviceInit(); - // Finalize the devmode manager dev_driver_server_->Finalize(); @@ -776,15 +774,6 @@ void RgpCaptureMgr::PostDeviceCreate() { auto* pDriverControlServer = dev_driver_server_->GetDriverControlServer(); assert(pDriverControlServer != nullptr); - - // If the driver hasn't been marked as fully initialized yet, mark it now. - // We consider the time after the logical device creation to be the fully initialized driver - // position. This is mainly because PAL is fully initialized at this point and we also know - // whether or not the debug vmid has been acquired. External tools use this information to - // decide when it's reasonable to make certain requests of the driver through protocol functions. - if (pDriverControlServer->IsDriverInitialized() == false) { - pDriverControlServer->FinishDeviceInit(); - } } // ================================================================================================