Skip to content

Commit 3488793

Browse files
JohannesGaesslerpkrmf
authored andcommitted
CUDA: fix scratch malloced on non-main device (ggml-org#3220)
1 parent 3c74b23 commit 3488793

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)