You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: MinGW build fails to load models with "error loading model: PrefetchVirtualMemory unavailable" #9311
I believe the issue was introduced when the source was reorganized into folders. I'm able to work around it by adding the following to the top level CMakeLists.txt:
if (MINGW)
add_compile_definitions(_WIN32_WINNT=0x602)
endif()
so I believe the equivalent code is missing from some CMakeLists.txt files in subfolders (I tried adding it to examples/llama-bench/CMakeLists.txt but that wasn't enough to fix the issue).
I encountered the same PrefetchVirtualMemory unavailable error with llama-cpp-python on Windows. Disabling memory mapping via use_mmap=False resolved it instantly!
Hope this saves someone hours of debugging🛠️
Activity
jeberger commentedon Sep 4, 2024
I believe the issue was introduced when the source was reorganized into folders. I'm able to work around it by adding the following to the top level
CMakeLists.txt:so I believe the equivalent code is missing from some
CMakeLists.txtfiles in subfolders (I tried adding it toexamples/llama-bench/CMakeLists.txtbut that wasn't enough to fix the issue).homenkovo commentedon Sep 20, 2024
I had a similar problem. I just replaced #define _WIN32_WINNT 0x0601 with #define _WIN32_WINNT 0x0A00 in the <_mingw.h> file and it worked.
github-actions commentedon Nov 4, 2024
This issue was closed because it has been inactive for 14 days since being marked as stale.
theSoberSobber commentedon Jan 4, 2025
Why was this closed, I suffered the same error as this in current latest commit and fixed it using @homenkovo's solution
watkyns commentedon Feb 4, 2025
having same issue with b4628 and homenkovo's solution can fix it
0dminnimda commentedon Feb 5, 2025
No need to modify no files, a simple command line argument is enough:
robbyvids commentedon Feb 12, 2025
not worked on win 11 for me, using python script. Memory more than enough, it happen when loading to gpu or cpu.
vishal-ahirwar commentedon Feb 17, 2025
thanks it worked for me
Pigoomy commentedon May 4, 2025
I encountered the same PrefetchVirtualMemory unavailable error with llama-cpp-python on Windows. Disabling memory mapping via use_mmap=False resolved it instantly!
Hope this saves someone hours of debugging🛠️
julmich commentedon Jun 4, 2025
PrefetchVirtualMemory unavailable error with llama-cpp on Windows - b5514 sources - compiling with llvm-mingw_64
this CMAKE line share from 0dminnimda above fix the issue
-DCMAKE_CXX_FLAGS=-D_WIN32_WINNT=0x602