From 96808786b72f5ca2949f0b138a15297a326b0b02 Mon Sep 17 00:00:00 2001 From: Dou Xinpeng <15529241576@163.com> Date: Wed, 25 Sep 2024 11:30:38 +0800 Subject: [PATCH] cann: fix crash when llama-bench is running on multiple cann devices (llama/9627) --- ggml/src/ggml-cann/common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ggml/src/ggml-cann/common.h b/ggml/src/ggml-cann/common.h index e6a57010..edfa4961 100644 --- a/ggml/src/ggml-cann/common.h +++ b/ggml/src/ggml-cann/common.h @@ -227,6 +227,7 @@ struct ggml_backend_cann_context { * @brief Destructor for cleaning up resources. */ ~ggml_backend_cann_context() { + ggml_cann_set_device(device); if (copy_event != nullptr) { ACL_CHECK(aclrtDestroyEvent(copy_event)); }