[GH-ISSUE #2069] illegal hardware instruction ollama run llama2 #1197

Closed
opened 2026-04-12 10:58:33 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @LoveSlience on GitHub (Jan 19, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2069

When i download mac app then run ollama run llama2 has error 7326 illegal hardware instruction ollama run llama2

image
image

Originally created by @LoveSlience on GitHub (Jan 19, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2069 When i download mac app then run `ollama run llama2` has error `7326 illegal hardware instruction ollama run llama2` ![image](https://github.com/jmorganca/ollama/assets/22396365/58c5ab74-0a0e-4ed1-a074-da26f63bcd97) ![image](https://github.com/jmorganca/ollama/assets/22396365/9847a70c-5439-412c-8ae5-2270d615a68e)
Author
Owner

@easp commented on GitHub (Jan 19, 2024):

For some reason people have started having problems with Ollama running in Rosetta on MacOS. Try selecting the Mac app and hitting ⌘I (Get Info...) and checking to see if "Open Using Rosetta" is checked. If it is, uncheck it, quit and relaunch Ollama and try again.

<!-- gh-comment-id:1901017859 --> @easp commented on GitHub (Jan 19, 2024): For some reason people have started having problems with Ollama running in Rosetta on MacOS. Try selecting the Mac app and hitting ⌘I (Get Info...) and checking to see if "Open Using Rosetta" is checked. If it is, uncheck it, quit and relaunch Ollama and try again.
Author
Owner

@LeaveNhA commented on GitHub (Jan 20, 2024):

Running it with Rosetta could decrease the performance. Is it really a low-priority issue for you people, it's concerning.

<!-- gh-comment-id:1902238020 --> @LeaveNhA commented on GitHub (Jan 20, 2024): Running it with Rosetta could decrease the performance. Is it really a low-priority issue for you people, it's concerning.
Author
Owner

@LoveSlience commented on GitHub (Jan 22, 2024):

For some reason people have started having problems with Ollama running in Rosetta on MacOS. Try selecting the Mac app and hitting ⌘I (Get Info...) and checking to see if "Open Using Rosetta" is checked. If it is, uncheck it, quit and relaunch Ollama and try again.

I have checked and found that the Rosetta option was not selected during initialization. After downloading and installing again, I found that it still does not work
image

<!-- gh-comment-id:1903500078 --> @LoveSlience commented on GitHub (Jan 22, 2024): > For some reason people have started having problems with Ollama running in Rosetta on MacOS. Try selecting the Mac app and hitting ⌘I (Get Info...) and checking to see if "Open Using Rosetta" is checked. If it is, uncheck it, quit and relaunch Ollama and try again. I have checked and found that the Rosetta option was not selected during initialization. After downloading and installing again, I found that it still does not work ![image](https://github.com/jmorganca/ollama/assets/22396365/60915cd0-0236-49cb-aa3c-98a82e45cf47)
Author
Owner

@abinvs-2019 commented on GitHub (Jan 23, 2024):

+1

<!-- gh-comment-id:1905694859 --> @abinvs-2019 commented on GitHub (Jan 23, 2024): +1
Author
Owner

@jryio commented on GitHub (Jan 24, 2024):

Experiencing this broken verison Ollama on macOS Sonoma 14.2 (M1 Max Macbook Pro).

Ollama version 0.1.20

Open with Rosetta is NOT selected.


Related Issues:

<!-- gh-comment-id:1908613928 --> @jryio commented on GitHub (Jan 24, 2024): Experiencing this broken verison Ollama on macOS Sonoma 14.2 (M1 Max Macbook Pro). Ollama version 0.1.20 `Open with Rosetta` is NOT selected. --- Related Issues: * https://github.com/ollama/ollama/issues/1938 * https://github.com/ollama/ollama/issues/2065 * https://github.com/ollama/ollama/issues/2035
Author
Owner

@tleish commented on GitHub (Jan 26, 2024):

FYI, I was experiencing this same error on a Macbook M1 which led me to this issue:

$ ollama run llama2
Illegal instruction: 4

Based on this thread, I looked at the Ollama.app settings and "Open using Rosetta" was unchecked. However, I remembered that when the Macbook M1 first came out, there was some issues with homebrew and/or libraries using the Apple Silicon, and I remember reading about using Rosetta Stone with Homebrew. So I ran the following in my terminal:

$ brew config
...
macOS: 14.3-arm64
Rosetta 2: true

Note the last line. I must've installed homebrew with Rosetta years ago when first receiving the M1 (this might be a clue why several reporting have an M1). So, I went through a painful process of uninstalling/reinstalling (made easier using homebrew-bundle to dump my current homebrew libraries before uninstalling and then reinstall them afterward using brew bundle). I had to reinstall homebrew several times, after each install brew config still showed Rosetta 2: true. Finally after uninstalling homebrew and deleting homebrew Cellar directories I finally installed homebrew without Rosetta.

$ brew config
...
macOS: 14.3-arm64
Rosetta 2: false

After confirming Rosetta 2: false in my homebrew, I then retried the command ollama run llama2 and it worked. 🎉

Thanks for the tip around Rosetta.

One other thought, it's also possible someone has configured their terminal app to run with Rosetta, so I would check that as well if you are having issues.

<!-- gh-comment-id:1912363512 --> @tleish commented on GitHub (Jan 26, 2024): FYI, I was experiencing this same error on a Macbook M1 which led me to this issue: ```sh $ ollama run llama2 Illegal instruction: 4 ``` Based on this thread, I looked at the Ollama.app settings and "Open using Rosetta" was _unchecked_. However, I remembered that when the Macbook M1 first came out, there was some issues with homebrew and/or libraries using the Apple Silicon, and I remember reading about using Rosetta Stone with Homebrew. So I ran the following in my terminal: ``` $ brew config ... macOS: 14.3-arm64 Rosetta 2: true ``` Note the last line. I must've installed homebrew with Rosetta years ago when first receiving the M1 (this might be a clue why several reporting have an M1). So, I went through a painful process of uninstalling/reinstalling (made easier using [homebrew-bundle](https://github.com/Homebrew/homebrew-bundle) to dump my current homebrew libraries before uninstalling and then reinstall them afterward using `brew bundle`). I had to reinstall homebrew several times, after each install `brew config` still showed `Rosetta 2: true`. Finally after uninstalling homebrew and deleting homebrew Cellar directories I finally installed homebrew without Rosetta. ``` $ brew config ... macOS: 14.3-arm64 Rosetta 2: false ``` After confirming `Rosetta 2: false` in my homebrew, I then retried the command `ollama run llama2` and it worked. 🎉 Thanks for the tip around Rosetta. One other thought, it's also possible someone has configured their terminal app to run with Rosetta, so I would check that as well if you are having issues.
Author
Owner

@dhiltgen commented on GitHub (Jan 26, 2024):

We've recently added CPU variant support for CPUs without vector math extensions (AVX, AVX2, etc.) which as a side-effect, allows Ollama run under rosetta on arm macs. I think we can consider this fixed. If you're still seeing illegal instruction errors on 0.1.22 please re-open.

<!-- gh-comment-id:1912701014 --> @dhiltgen commented on GitHub (Jan 26, 2024): We've recently added CPU variant support for CPUs without vector math extensions (AVX, AVX2, etc.) which as a side-effect, allows Ollama run under rosetta on arm macs. I think we can consider this fixed. If you're still seeing illegal instruction errors on 0.1.22 please re-open.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1197