[PR #4172] Add support for the BSD platforms #16677

Open
opened 2026-04-16 05:39:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/4172
Author: @prep
Created: 5/5/2024
Status: 🔄 Open

Base: mainHead: feature/add-bsd-support


📝 Commits (3)

📊 Changes

9 files changed (+207 additions, -2 deletions)

View changed files

gpu/gpu_bsd.go (+93 -0)
📝 gpu/gpu_info_cpu.c (+2 -0)
📝 gpu/gpu_test.go (+3 -1)
llm/generate/gen_bsd.sh (+64 -0)
📝 llm/generate/gen_common.sh (+1 -1)
llm/generate/generate_bsd.go (+5 -0)
📝 llm/llm.go (+4 -0)
llm/llm_bsd.go (+8 -0)
scripts/build_bsd.sh (+27 -0)

📄 Description

This PR adds the ability to compile and run Ollama on various BSD platforms, specifically DragonFly, FreeBSD, NetBSD and OpenBSD. A couple notes:

  1. It includes support for Vulkan to offload work to the GPU.
  2. It's only been tested on OpenBSD, but hopefully interested parties in this community can test the other platforms.
  3. ollama run is broken on OpenBSD. The readline package uses syscall which OpenBSD has removed from libc and the kernel. Instead, the readline package should be updated to use golang.org/x/sys/unix, similar to how ergochat/readline does it. I didn't want to include that work in this PR.
  4. The tweak in gen_common.sh is to remove a bash'ism so that the file can be sourced from ksh.

On OpenBSD I needed to add these packages:

pkg_add cmake go vulkan-headers

The other platforms will probably have similarly named packages to install.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/4172 **Author:** [@prep](https://github.com/prep) **Created:** 5/5/2024 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/add-bsd-support` --- ### 📝 Commits (3) - [`2c65b8d`](https://github.com/ollama/ollama/commit/2c65b8d50322e8188f7c7acd45c593fe5e5029be) Add support for BSD - [`798d01f`](https://github.com/ollama/ollama/commit/798d01fccf45c60faa0c53a565c7208f1e90d4dc) reorder because OCD - [`c3e93f4`](https://github.com/ollama/ollama/commit/c3e93f4f8ca4349c4d09cb3db59c12b880dfc3f9) more OCD ordering ### 📊 Changes **9 files changed** (+207 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `gpu/gpu_bsd.go` (+93 -0) 📝 `gpu/gpu_info_cpu.c` (+2 -0) 📝 `gpu/gpu_test.go` (+3 -1) ➕ `llm/generate/gen_bsd.sh` (+64 -0) 📝 `llm/generate/gen_common.sh` (+1 -1) ➕ `llm/generate/generate_bsd.go` (+5 -0) 📝 `llm/llm.go` (+4 -0) ➕ `llm/llm_bsd.go` (+8 -0) ➕ `scripts/build_bsd.sh` (+27 -0) </details> ### 📄 Description This PR adds the ability to compile and run Ollama on various BSD platforms, specifically DragonFly, FreeBSD, NetBSD and OpenBSD. A couple notes: 1. It includes support for Vulkan to offload work to the GPU. 2. It's only been tested on OpenBSD, but hopefully interested parties in this community can test the other platforms. 3. `ollama run` is broken on OpenBSD. The [readline](readline) package uses `syscall` which OpenBSD [has removed from libc and the kernel](https://marc.info/?l=openbsd-tech&m=169841790407370&w=2). Instead, the readline package should be updated to use `golang.org/x/sys/unix`, similar to how [ergochat/readline](https://github.com/ergochat/readline) does it. I didn't want to include that work in this PR. 4. The tweak in `gen_common.sh` is to remove a bash'ism so that the file can be sourced from `ksh`. On OpenBSD I needed to add these packages: ```pkg_add cmake go vulkan-headers``` The other platforms will probably have similarly named packages to install. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 05:39:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#16677