Install prerequisites:
Then build and run Ollama from the root directory of the repository:
go run . serve
macOS Apple Silicon supports Metal which is built-in to the Ollama binary. No additional steps are required.
Install prerequisites:
brew install cmake
Then, configure and build the project:
cmake -B build
cmake --build build
Lastly, run Ollama:
go run . serve
Install prerequisites:
[!IMPORTANT] Ensure prerequisites are in
PATH
before running CMake.[!IMPORTANT] ROCm is not compatible with Visual Studio CMake generators. Use
-GNinja
when configuring the project.[!IMPORTANT] CUDA is only compatible with Visual Studio CMake generators.
Then, configure and build the project:
cmake -B build
cmake --build build --config Release
Lastly, run Ollama:
go run . serve
Windows ARM does not support additional acceleration libraries at this time.
Install prerequisites:
sudo apt install cmake
or sudo dnf install cmake
[!IMPORTANT] Ensure prerequisites are in
PATH
before running CMake.
Then, configure and build the project:
cmake -B build
cmake --build build
Lastly, run Ollama:
go run . serve
docker build .
docker build --build-arg FLAVOR=rocm .
To run tests, use go test
:
go test ./...
Ollama looks for acceleration libraries in the following paths relative to the ollama
executable:
./lib/ollama
(Windows)../lib/ollama
(Linux).
(macOS)build/lib/ollama
(for development)If the libraries are not found, Ollama will not run with any acceleration libraries.