Skip to content

Commit bd21613

Browse files
committed
add a host_buft assert in case of integrated_cuda_device with func:'evaluate_and_capture_cuda_graph()'
1 parent 075fae3 commit bd21613

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2645,6 +2645,8 @@ static void update_cuda_graph_executable(ggml_backend_cuda_context * cuda_ctx) {
26452645

26462646
static void evaluate_and_capture_cuda_graph(ggml_backend_cuda_context * cuda_ctx, ggml_cgraph * cgraph,
26472647
bool & graph_evaluated_or_captured, bool & use_cuda_graph, bool & cuda_graph_update_required) {
2648+
//flag used to determine whether it is an integrated_gpu
2649+
const bool integrated = ggml_cuda_info().devices[cuda_ctx->device].integrated;
26482650

26492651
while (!graph_evaluated_or_captured) {
26502652
// Only perform the graph execution if CUDA graphs are not enabled, or we are capturing the graph.
@@ -2663,7 +2665,7 @@ static void evaluate_and_capture_cuda_graph(ggml_backend_cuda_context * cuda_ctx
26632665
if (node->src[j] != nullptr) {
26642666
assert(node->src[j]->buffer);
26652667
assert(node->src[j]->buffer->buft == ggml_backend_cuda_buffer_type(cuda_ctx->device) ||
2666-
ggml_backend_buft_is_cuda_split(node->src[j]->buffer->buft));
2668+
ggml_backend_buft_is_cuda_split(node->src[j]->buffer->buft) || (integrated && ggml_backend_buft_is_cuda_host(node->src[j]->buffer->buft)));
26672669
}
26682670
}
26692671
#endif

0 commit comments

Comments
 (0)