-
Notifications
You must be signed in to change notification settings - Fork 12k
server: Windows 7 compatibility #8208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I'm not very confident with this change, because httplib is copied from external repo: https://github.com/yhirose/cpp-httplib All the changes made here in llama.cpp will be overwritten when we sync with upstream source code |
89153d0
to
1e2baaf
Compare
@ngxson the upstream repo has fixed the issue (yhirose/cpp-httplib#1869), set After I update the httplib to the latest version, I find I set I compile the project on win11 with vs2022 and msys2-mingw64 and both executables works on win7 (msys2-ucrt doesn't work). What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late response. As I'm not using windows (and I don't know any of llama.cpp's collaborators use windows 7), I can't verify if this PR have any side effects or not. I can only merge if the change involve upgrading to upstream httplib. Hope you understand that. In case there's nobody who can test this PR, we can still keep this as a demo.
@@ -442,8 +442,7 @@ ifneq '' '$(findstring mingw,$(shell $(CC) -dumpmachine))' | |||
MK_CFLAGS += -Xassembler -muse-unaligned-vector-move | |||
MK_CXXFLAGS += -Xassembler -muse-unaligned-vector-move | |||
|
|||
# Target Windows 8 for PrefetchVirtualMemory | |||
MK_CPPFLAGS += -D_WIN32_WINNT=0x602 | |||
MK_CPPFLAGS += -D_WIN32_WINNT=_WIN32_WINNT_WIN7 -DWINVER=_WIN32_WINNT_WIN7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this has any effects on other versions of windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this has any effects on other versions of windows
According to https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt: "The preprocessor macros WINVER and _WIN32_WINNT specify the minimum operating system version your code supports".
This will prevent windows sdk header file declare functions only available on higher windows versions. So as long as the project can compile, it should have no effects on other windows versions.
…IN32_WINNT<_WIN32_WINNT_WIN8
… to make it work under MinGW
2567073 works on my Windows 7, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works in mine too, thx for making the changes in the code.
Hi Zor-X-L Any chance you remember which cuda version you used to compile it? or you only test it on CPU? I was able to build the old version with the help of your pr for CPU but not cuda. And do you think you can mak a pr for the latest version too for win 7? Thanks! |
Last CUDA that officially supports Windows 7 is 10.2, but build with 10.2 is probably broken long ago #4123 |
oh, that makes sense, thanks, I spent my whole day trying to find the issue and I couldn't I though I have some issue on my side, IO was getting "nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified" and I thought I have the wrong cuda, I even tried to compile it using 11.2 on windows 10 but couldn't either (the old version of llama.cpp that supported win 7). I guess its not easy anymore to let llama.cpp to support win 7. I wonder if there is any other runtimes that I could use with win 7 that support cuda. |
The latest version has merge conflict with this pr, but I think these conflicts are not difficult to solve. |
Could you please link the pr? does your pr let us compile it and run on windows 7 including the webclient? |
Please remove the following lines in
nvcc from cuda 10.2 cannot recognize /utf8 option. I have successfully compile this PR version using VS2017 + Cuda 10.2 on win7. |
I want to run the server on a Win7 box, and the API calls to CreateFile2/CreateFileMappingFromApp/MapViewOfFileFromApp in httplib.h prevent this (need Win8 at least), so I change them to CreateFileW/CreateFileMappingW/MapViewOfFile.
I tested the code on Win7 with qwen2-0_5b-instruct-q4_k_m (about 400MiB) and on Win11 with Yi-1.5-34B-Chat-IQ4_XS (about 18GiB), they all work fine.
In theory it can run on XP or Vista, but I don't have test environments.