mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-24 10:24:35 +00:00
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
This commit is contained in:
parent
447ccbe8c3
commit
cbebf61ca7
@ -2553,6 +2553,7 @@ void ggml_cuda_assign_buffers_impl(struct ggml_tensor * tensor, bool scratch) {
|
|||||||
|
|
||||||
tensor->backend = GGML_BACKEND_GPU;
|
tensor->backend = GGML_BACKEND_GPU;
|
||||||
struct ggml_tensor_extra_gpu * extra = new ggml_tensor_extra_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) ||
|
const bool inplace = (tensor->src0 != nullptr && tensor->src0->data == tensor->data) ||
|
||||||
tensor->op == GGML_OP_VIEW;
|
tensor->op == GGML_OP_VIEW;
|
||||||
|
Loading…
Reference in New Issue
Block a user