Skip to content
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

Makefile uses -march=native unconditionally, it will break building on PowerPC where it is not supported #1269

Open
barracuda156 opened this issue Dec 16, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@barracuda156
Copy link

On PowerPC -mtune=native and -mcpu=native are supported but not -march=native. This should be fixed in Makefile: https://github.com/LostRuins/koboldcpp/blob/concedo/Makefile

CMakeLists have correct flags but wrong arch detection, which will omit ppc: https://github.com/LostRuins/koboldcpp/blob/concedo/CMakeLists.txt
Correct check will be elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc|powerpc") (it does not matter if it is 32- or 64-bit, same flags are used).

@LostRuins LostRuins added the bug Something isn't working label Dec 17, 2024
@LostRuins
Copy link
Owner

Hi, can you please verify if ppc is actually using -march=native unconditionally? In the makefile, I am checking

ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))

that is the only branch that triggers -march=native
which should NOT trigger on a ppc device.

Can you verify if this is a new issue or did it exist before? And if it's still triggering, can you please share the env var values displayed in terminal during the make process here.

$(info I koboldcpp build info: )
$(info I UNAME_S:  $(UNAME_S))
$(info I UNAME_P:  $(UNAME_P))
$(info I UNAME_M:  $(UNAME_M))
$(info I UNAME_O:  $(UNAME_O))
$(info I CFLAGS:   $(CFLAGS))
$(info I CXXFLAGS: $(CXXFLAGS))
$(info I LDFLAGS:  $(LDFLAGS))
$(info I CC:       $(CCV))
$(info I CXX:      $(CXXV))
$(info )

As for the cmake file, it only supports building for CUDA on windows, you should not use it. Please make sure you're on the latest experimental branch.

@LostRuins
Copy link
Owner

Is this resolved?

@barracuda156
Copy link
Author

barracuda156 commented Dec 20, 2024

@LostRuins I beg a pardon, perhaps I looked at the makefile without getting a coffee. You are right, of course, that code won’t apply on powerpc.

uname -m returns Power Macintosh on Darwin on PowerPC, uname -p returns powerpc. I think uname -o is invalid, but need to check when I am back to the machine.

@LostRuins
Copy link
Owner

Alright, do a test and let me know if the makefile has errors. If there are errors, do post the console output with the specific error and line number. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants