Skip to content

[GPU] Allocate output mem using virtual memory in Windows even if physical memory is full #30106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/plugins/intel_gpu/src/runtime/ocl/ocl_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ bool ocl_engine::check_allocatable(const layout& layout, allocation_type type) {
GPU_DEBUG_COUT << "[Warning] [GPU] Exceeded max size of memory allocation: " << "Required " << layout.bytes_count() << " bytes, already occupied : "
<< used_mem << " bytes, but available memory size is " << get_max_memory_size() << " bytes" << std::endl;
GPU_DEBUG_COUT << "Please note that performance might drop due to memory swap." << std::endl;
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random spot) could you check additional assertion whether the primitive has output buffer when executed? this would be helpful for future troubleshoot of such issue.

Copy link
Contributor Author

@kelvinchoi-intel kelvinchoi-intel Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added assertions at set_arguments_impl() which allocated memory is necessary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random spot) PR title is difficult to understand. Could you rewrite it to express what it is doing or why it matters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated PR title

#endif

Expand Down
24 changes: 12 additions & 12 deletions src/plugins/intel_gpu/src/runtime/ocl/ocl_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ void set_arguments_impl(ocl_kernel_type& kernel,
cl_int status = CL_INVALID_ARG_VALUE;
switch (args[i].t) {
case args_t::INPUT:
if (args[i].index < data.inputs.size() && data.inputs[args[i].index]) {
status = set_kernel_arg(kernel, i, data.inputs[args[i].index]);
}
OPENVINO_ASSERT(args[i].index < data.inputs.size() && data.inputs[args[i].index],
"The allocated input memory is necessary to set kernel arguments.");
status = set_kernel_arg(kernel, i, data.inputs[args[i].index]);
break;
case args_t::INPUT_OF_FUSED_PRIMITIVE:
if (args[i].index < data.fused_op_inputs.size() && data.fused_op_inputs[args[i].index]) {
status = set_kernel_arg(kernel, i, data.fused_op_inputs[args[i].index]);
}
OPENVINO_ASSERT(args[i].index < data.fused_op_inputs.size() && data.fused_op_inputs[args[i].index],
"The allocated fused_op_input memory is necessary to set kernel arguments.");
status = set_kernel_arg(kernel, i, data.fused_op_inputs[args[i].index]);
break;
case args_t::INTERNAL_BUFFER:
if (args[i].index < data.intermediates.size() && data.intermediates[args[i].index]) {
status = set_kernel_arg(kernel, i, data.intermediates[args[i].index]);
}
OPENVINO_ASSERT(args[i].index < data.intermediates.size() && data.intermediates[args[i].index],
"The allocated intermediate memory is necessary to set kernel arguments.");
status = set_kernel_arg(kernel, i, data.intermediates[args[i].index]);
break;
case args_t::OUTPUT:
if (args[i].index < data.outputs.size() && data.outputs[args[i].index]) {
status = set_kernel_arg(kernel, i, data.outputs[args[i].index]);
}
OPENVINO_ASSERT(args[i].index < data.outputs.size() && data.outputs[args[i].index],
"The allocated output memory is necessary to set kernel arguments.");
status = set_kernel_arg(kernel, i, data.outputs[args[i].index]);
break;
case args_t::WEIGHTS:
status = set_kernel_arg(kernel, i, data.weights);
Expand Down
Loading