Skip to content

Commit 578d8c8

Browse files
CUDA: fix scratch malloced on non-main device (#3220)
1 parent b541b4f commit 578d8c8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ggml-cuda.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6970,6 +6970,7 @@ void ggml_cuda_assign_scratch_offset(struct ggml_tensor * tensor, size_t offset)
69706970
return;
69716971
}
69726972
if (g_scratch_buffer == nullptr) {
6973+
ggml_cuda_set_device(g_main_device);
69736974
CUDA_CHECK(cudaMalloc(&g_scratch_buffer, g_scratch_size));
69746975
}
69756976

0 commit comments

Comments
 (0)