diff options
author | Johannes Gäßler <johannesg@5d6.de> | 2023-09-17 14:16:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-17 14:16:22 +0200 |
commit | 578d8c8f5cb72f354bc115ba230ee5b2d803eee7 (patch) | |
tree | 4170e677428215447af30d637ceb10409b7f444b /ggml-cuda.cu | |
parent | b541b4f0b1d4d9871c831e47cd5ff661039d6101 (diff) |
CUDA: fix scratch malloced on non-main device (#3220)
Diffstat (limited to 'ggml-cuda.cu')
-rw-r--r-- | ggml-cuda.cu | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ggml-cuda.cu b/ggml-cuda.cu index dbe53cee..248cb2c4 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -6970,6 +6970,7 @@ void ggml_cuda_assign_scratch_offset(struct ggml_tensor * tensor, size_t offset) return; } if (g_scratch_buffer == nullptr) { + ggml_cuda_set_device(g_main_device); CUDA_CHECK(cudaMalloc(&g_scratch_buffer, g_scratch_size)); } |