[GH-ISSUE #987] segmentation fault with prompts longer than 5 / 6 tokens on intel mac #46992

Closed
opened 2026-04-28 02:31:12 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @Serpico84 on GitHub (Nov 3, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/987

I'm running Ollama on a 2019 intel MacBook Pro with 32gb of RAM and a 4gb AMD GPU. macOS Monterey.
For some reson, every prompt longer than a few words on both codellama:7b and llama2:7b end up with Error: llama runner exited, you may not have enough available memory to run this model

Very short prompts work ok.

This is the server log file:

llama_new_context_with_model: n_ctx      = 2048
llama_new_context_with_model: freq_base  = 1000000.0
llama_new_context_with_model: freq_scale = 1
llama_new_context_with_model: kv self size  = 1024.00 MB
llama_new_context_with_model: compute buffer total size = 162.13 MB
llama server listening at http://127.0.0.1:49879

{"timestamp":1699023783,"level":"INFO","function":"main","line":1749,"message":"HTTP server listening","hostname":"127.0.0.1","port":49879}
{"timestamp":1699023783,"level":"INFO","function":"log_server_request","line":1240,"message":"request","remote_addr":"127.0.0.1","remote_port":50344,"status":200,"method":"HEAD","path":"/","params":{}}
2023/11/03 16:03:03 llama.go:442: llama runner started in 1.001631 seconds
[GIN] 2023/11/03 - 16:03:03 | 200 |  1.143871095s |       127.0.0.1 | POST     "/api/generate"
{"timestamp":1699023810,"level":"INFO","function":"log_server_request","line":1240,"message":"request","remote_addr":"127.0.0.1","remote_port":50346,"status":200,"method":"HEAD","path":"/","params":{}}
2023/11/03 16:03:30 llama.go:385: signal: segmentation fault
2023/11/03 16:03:30 llama.go:459: llama runner stopped successfully
[GIN] 2023/11/03 - 16:03:30 | 200 |  227.020112ms |       127.0.0.1 | POST     "/api/generate"

Not sure what can I do to tackle this problem or provide any more info, as far as I know I should be able to run those models just fine with my machine.

Originally created by @Serpico84 on GitHub (Nov 3, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/987 I'm running Ollama on a 2019 intel MacBook Pro with 32gb of RAM and a 4gb AMD GPU. macOS Monterey. For some reson, every prompt longer than a few words on both codellama:7b and llama2:7b end up with `Error: llama runner exited, you may not have enough available memory to run this model` Very short prompts work ok. This is the server log file: ``` llama_new_context_with_model: n_ctx = 2048 llama_new_context_with_model: freq_base = 1000000.0 llama_new_context_with_model: freq_scale = 1 llama_new_context_with_model: kv self size = 1024.00 MB llama_new_context_with_model: compute buffer total size = 162.13 MB llama server listening at http://127.0.0.1:49879 {"timestamp":1699023783,"level":"INFO","function":"main","line":1749,"message":"HTTP server listening","hostname":"127.0.0.1","port":49879} {"timestamp":1699023783,"level":"INFO","function":"log_server_request","line":1240,"message":"request","remote_addr":"127.0.0.1","remote_port":50344,"status":200,"method":"HEAD","path":"/","params":{}} 2023/11/03 16:03:03 llama.go:442: llama runner started in 1.001631 seconds [GIN] 2023/11/03 - 16:03:03 | 200 | 1.143871095s | 127.0.0.1 | POST "/api/generate" {"timestamp":1699023810,"level":"INFO","function":"log_server_request","line":1240,"message":"request","remote_addr":"127.0.0.1","remote_port":50346,"status":200,"method":"HEAD","path":"/","params":{}} 2023/11/03 16:03:30 llama.go:385: signal: segmentation fault 2023/11/03 16:03:30 llama.go:459: llama runner stopped successfully [GIN] 2023/11/03 - 16:03:30 | 200 | 227.020112ms | 127.0.0.1 | POST "/api/generate" ``` Not sure what can I do to tackle this problem or provide any more info, as far as I know I should be able to run those models just fine with my machine.
Author
Owner

@calebrcannon commented on GitHub (Nov 4, 2023):

I have the same issue

<!-- gh-comment-id:1793356158 --> @calebrcannon commented on GitHub (Nov 4, 2023): I have the same issue
Author
Owner

@gregahren commented on GitHub (Nov 4, 2023):

Same problem here.

<!-- gh-comment-id:1793434861 --> @gregahren commented on GitHub (Nov 4, 2023): Same problem here.
Author
Owner

@FetchFast commented on GitHub (Nov 6, 2023):

Same here, even with orca-mini. Just to confirm, "bin/ollama-runner: bad CPU type in executable" is irrelevant?

But llama2 with ID fe938a131f40 works for me.

I have a 2015 MBP, 8GB ram though. Maybe I've got no GPU to confuse it...?

<!-- gh-comment-id:1797050763 --> @FetchFast commented on GitHub (Nov 6, 2023): Same here, even with orca-mini. Just to confirm, "bin/ollama-runner: bad CPU type in executable" is irrelevant? But llama2 with ID fe938a131f40 works for me. I have a 2015 MBP, 8GB ram though. Maybe I've got no GPU to confuse it...?
Author
Owner

@sizhky commented on GitHub (Nov 7, 2023):

But llama2 with ID fe938a131f40 works for me.

I'm using the default llama2 model. Does it have this specific id? If not how do I run this specific ID?

<!-- gh-comment-id:1797731993 --> @sizhky commented on GitHub (Nov 7, 2023): > But llama2 with ID fe938a131f40 works for me. I'm using the default llama2 model. Does it have this specific id? If not how do I run this specific ID?
Author
Owner

@bgokden commented on GitHub (Nov 8, 2023):

Same issue. Is there a recommended solution?

<!-- gh-comment-id:1802821514 --> @bgokden commented on GitHub (Nov 8, 2023): Same issue. Is there a recommended solution?
Author
Owner

@orlyandico commented on GitHub (Nov 17, 2023):

It seems my bug report is a duplicate of this. I was getting the same error on my Mac Pro 2013 with Monterey 12.7.1 - but not on my MBP16 2019 with Ventura 13.4.1(c) which does have an Intel processor also.

So it appears to be OS-related.

I'll try to OCLP the trashcan to Ventura and see if this error disappears... would appreciate if the other folks with this error (and with natively Ventura-capable Macs) also test.

<!-- gh-comment-id:1815579415 --> @orlyandico commented on GitHub (Nov 17, 2023): It seems my bug report is a duplicate of this. I was getting the same error on my Mac Pro 2013 with Monterey 12.7.1 - but not on my MBP16 2019 with Ventura 13.4.1(c) which does have an Intel processor also. So it appears to be OS-related. I'll try to OCLP the trashcan to Ventura and see if this error disappears... would appreciate if the other folks with this error (and with natively Ventura-capable Macs) also test.
Author
Owner

@jmorganca commented on GitHub (Nov 17, 2023):

Hi all, I'm so sorry you hit this bug on Intel Macs. This should be fixed as of 41434a7. A new release should be out early tomorrow but in the meantime you can try the prerelease version here https://github.com/jmorganca/ollama/releases/tag/v0.1.10. Again thanks for creating an issue and your patience!

<!-- gh-comment-id:1815685095 --> @jmorganca commented on GitHub (Nov 17, 2023): Hi all, I'm so sorry you hit this bug on Intel Macs. This should be fixed as of [`41434a7`](https://github.com/jmorganca/ollama/commit/41434a7cdcf33918ae2d37eb23d819ef7361e843). A new release should be out early tomorrow but in the meantime you can try the prerelease version here https://github.com/jmorganca/ollama/releases/tag/v0.1.10. Again thanks for creating an issue and your patience!
Author
Owner

@xyklex commented on GitHub (Dec 10, 2023):

Hi @jmorganca I've downloaded Ollama version 0.1.14, but it is running entirely on CPUs, is there a flag I should enable before running the model?
image

<!-- gh-comment-id:1849120696 --> @xyklex commented on GitHub (Dec 10, 2023): Hi @jmorganca I've downloaded Ollama version 0.1.14, but it is running entirely on CPUs, is there a flag I should enable before running the model? ![image](https://github.com/jmorganca/ollama/assets/483287/f246f308-31ea-4f21-ab8f-9a8fc2023c33)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#46992