Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 12b063f

Browse filesBrowse files
JoelSeniorLiangliang
andauthored
Fixed WSL cuda's OOM error (abetlen#1594)
* In the function , add the cuda error bypass. * remove excessive codes and prints --------- Co-authored-by: liang <liangmanlai@126.com>
1 parent 31d2b5f commit 12b063f
Copy full SHA for 12b063f

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎ggml-cuda.cu

Copy file name to clipboardExpand all lines: ggml-cuda.cu
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,9 @@ void * ggml_cuda_host_malloc(size_t size) {
11051105
void * ptr = nullptr;
11061106
cudaError_t err = cudaMallocHost((void **) &ptr, size);
11071107
if (err != cudaSuccess) {
1108+
// The allocation error can be bypassed. A null ptr will assigned out of this function.
1109+
// This can fixed the OOM error in WSL.
1110+
cudaGetLastError();
11081111
fprintf(stderr, "WARNING: failed to allocate %.2f MB of pinned memory: %s\n",
11091112
size/1024.0/1024.0, cudaGetErrorString(err));
11101113
return nullptr;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.