Skip to content

Commit cbebf61

Browse files
authored
Fix assert when free invalid cuda pointer (ggml-org#2005)
Fix assert via initializing extra structure always. CUDA error 1 at C:\GPT\llama.cpp\ggml-cuda.cu:2536: invalid argument
1 parent 447ccbe commit cbebf61

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ggml-cuda.cu

+1
Original file line numberDiff line numberDiff line change
@@ -2553,6 +2553,7 @@ void ggml_cuda_assign_buffers_impl(struct ggml_tensor * tensor, bool scratch) {
25532553

25542554
tensor->backend = GGML_BACKEND_GPU;
25552555
struct ggml_tensor_extra_gpu * extra = new ggml_tensor_extra_gpu;
2556+
memset(extra, 0, sizeof(*extra));
25562557

25572558
const bool inplace = (tensor->src0 != nullptr && tensor->src0->data == tensor->data) ||
25582559
tensor->op == GGML_OP_VIEW;

0 commit comments

Comments
 (0)