From 6dce6cc599c9078f8405631c015454e8f0b2b0f9 Mon Sep 17 00:00:00 2001 From: Wilson Seok Date: Mon, 30 Oct 2023 21:27:50 +0900 Subject: [PATCH] [GPU] Fix va surface sharing issue (#20730) --- src/plugins/intel_gpu/src/plugin/remote_tensor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/intel_gpu/src/plugin/remote_tensor.cpp b/src/plugins/intel_gpu/src/plugin/remote_tensor.cpp index 9bf19f8df50..0c4851b2f68 100644 --- a/src/plugins/intel_gpu/src/plugin/remote_tensor.cpp +++ b/src/plugins/intel_gpu/src/plugin/remote_tensor.cpp @@ -109,6 +109,10 @@ void RemoteTensorImpl::allocate() { auto context = std::dynamic_pointer_cast(m_context); auto enable_caching = supports_caching(); + if (is_surface()) { + m_layout.format = cldnn::format::nv12; // Other formats are not supported + } + if (enable_caching) { m_memory_object = context->try_get_cached_memory(m_hash); if (m_memory_object) { @@ -156,7 +160,6 @@ void RemoteTensorImpl::allocate() { } #ifdef _WIN32 case TensorType::BT_SURF_SHARED: { - m_layout.format = cldnn::format::nv12; // Other formats are not supported m_memory_object = engine.share_surface(m_layout, m_mem, m_plane); break; } @@ -166,13 +169,11 @@ void RemoteTensorImpl::allocate() { } #else case TensorType::BT_SURF_SHARED: { - m_layout.format = cldnn::format::nv12; // Other formats are not supported m_memory_object = engine.share_surface(m_layout, m_surf, m_plane); break; } #endif case TensorType::BT_IMG_SHARED: { - m_layout.format = cldnn::format::nv12; // Other formats are not supported m_memory_object = engine.share_image(m_layout, m_mem); break; } @@ -218,8 +219,7 @@ void RemoteTensorImpl::update_hash() { bool RemoteTensorImpl::is_surface() const noexcept { return m_mem_type == TensorType::BT_SURF_SHARED || - m_mem_type == TensorType::BT_IMG_SHARED || - m_mem_type == TensorType::BT_DX_BUF_SHARED; + m_mem_type == TensorType::BT_IMG_SHARED; } cldnn::memory::ptr RemoteTensorImpl::get_memory() const {