aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Su <howard0su@gmail.com>2023-06-26 23:15:47 +0800
committerGitHub <noreply@github.com>2023-06-26 23:15:47 +0800
commitcbebf61ca7584e9709265395f0127ae7fc0f1882 (patch)
treee0468077b108923a7e7e155992e75163d439f908
parent447ccbe8c39332fcdd0d98a041b6e2ff6f06219d (diff)
Fix assert when free invalid cuda pointer (#2005)
Fix assert via initializing extra structure always. CUDA error 1 at C:\GPT\llama.cpp\ggml-cuda.cu:2536: invalid argument
-rw-r--r--ggml-cuda.cu1
1 files changed, 1 insertions, 0 deletions
diff --git a/ggml-cuda.cu b/ggml-cuda.cu
index 010682e..5e2fbc7 100644
--- a/ggml-cuda.cu
+++ b/ggml-cuda.cu
@@ -2553,6 +2553,7 @@ void ggml_cuda_assign_buffers_impl(struct ggml_tensor * tensor, bool scratch) {
tensor->backend = GGML_BACKEND_GPU;
struct ggml_tensor_extra_gpu * extra = new ggml_tensor_extra_gpu;
+ memset(extra, 0, sizeof(*extra));
const bool inplace = (tensor->src0 != nullptr && tensor->src0->data == tensor->data) ||
tensor->op == GGML_OP_VIEW;