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

ggml.c: error: 'SYS_getcpu' undeclared did you mean 'SYS_get_cpu' #1894

Closed
themanyone opened this issue Feb 22, 2024 · 7 comments · Fixed by ggml-org/llama.cpp#5906
Closed

Comments

@themanyone
Copy link

themanyone commented Feb 22, 2024

On both projects, whisper.cpp, and llama.cpp, we get this compilation error with latest git when compiling with CUBLAS.

WHISPER_CUBLAS=1 make -j

ggml.c: In function 'ggml_numa_init':
ggml.c:2088:26: error: 'SYS_getcpu' undeclared (first use in this function); did you mean 'SYS_get_cpu'?
 2088 |     getcpu_ret = syscall(SYS_getcpu,&current_cpu,&g_state.numa.current_node);
      |                          ^~~~~~~~~~
      |                          SYS_get_cpu
ggml.c:2088:26: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:317: ggml.o] Error 1

The fix is very straightforward. We simply drop in SYS_get_cpu.

@petterreinholdtsen
Copy link
Contributor

I created bull request #1897 based on your description, and hope it will be included in the master branch soon.

@ggerganov
Copy link
Owner

ggerganov commented Feb 24, 2024

Hm, that's strange. We should be able to check which of the 2 is available (SYS_getcpu or SYS_get_cpu) and use the correct one

cc @bmtwl Any ideas?

Edit: there is already a discussion in llama.cpp: ggml-org/llama.cpp#5694 so let's figure it out there

@petterreinholdtsen
Copy link
Contributor

petterreinholdtsen commented Feb 24, 2024 via email

petterreinholdtsen added a commit to petterreinholdtsen/whisper.cpp that referenced this issue Feb 24, 2024
…s missing.

Handle both SYS_get_cpu and SYS_getcpu, even though I am unsure if both ever existed,
and make sure to error out if neither of them are available.

Fixes ggerganov#1894.
@themanyone
Copy link
Author

That should do it. I'm stuck using gcc-12 for acceleration, because Nvidia cuBLAS requires it for their old glibc workarounds (Nvidia's workarounds conflict with gcc-13's hot patches which [re]address the same issue, leading to conflicts).

@ggerganov
Copy link
Owner

Ok, would like to hear if @cebtenzzre agrees before merging

@bmtwl
Copy link
Contributor

bmtwl commented Feb 25, 2024

I tested the proposed strategy on a private branch and it worked through the permutations I tried.

+#if defined SYS_get_cpu
+ getcpu_ret = syscall(SYS_get_cpu,&current_cpu,&g_state.numa.current_node);
+#elif defined SYS_getcpu
getcpu_ret = syscall(SYS_getcpu,&current_cpu,&g_state.numa.current_node);
+#endif

Has a PR been submitted for this issue, or is there still a need for one?

@petterreinholdtsen
Copy link
Contributor

petterreinholdtsen commented Feb 25, 2024 via email

cebtenzzre added a commit to ggml-org/llama.cpp that referenced this issue Mar 6, 2024
cebtenzzre added a commit to ggml-org/llama.cpp that referenced this issue Mar 6, 2024
github-actions bot pushed a commit to KerfuffleV2/ggml-sys-bleedingedge that referenced this issue Mar 7, 2024
== Relevant log messages from source repo:

commit e04e04f8fad549bb0b3ec1c91f0413aeb08baf29
Author: Jared Van Bortel <jared@nomic.ai>
Date:   Wed Mar 6 15:42:23 2024 -0500

    ggml : use SYS_get_cpu if SYS_getcpu is not defined (#5906)

    Fixes #5694
    Fixes ggerganov/whisper.cpp#1894
ggerganov pushed a commit that referenced this issue Mar 8, 2024
jiahansu pushed a commit to WiseSync/whisper.cpp that referenced this issue Apr 17, 2024
viktor-silakov pushed a commit to viktor-silakov/whisper_node_mic.cpp that referenced this issue May 11, 2024
iThalay pushed a commit to iThalay/whisper.cpp that referenced this issue Sep 23, 2024
iThalay pushed a commit to iThalay/whisper.cpp that referenced this issue Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants