[GH-ISSUE #9012] go run . Server error #67915

Closed
opened 2026-05-04 12:01:23 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @dhadialhda on GitHub (Feb 11, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9012

What is the issue?

I compiled it on the cuda environment of Windows, sln file, and executed the command go run . When server, I directly looked for AMD's code, not CUDA's code

\ollama> go run . server
github.com/ollama/ollama/llama: build constraints exclude all Go files in D:\Desktop\ollama\ollama\llama

github.com/ollama/ollama/discover

discover\amd_windows.go:116:33: undefined: rocmMinimumMemory
discover\amd_windows.go:126:63: undefined: IGPUMemLimit
discover\amd_windows.go:129:38: undefined: unsupportedGPUs
discover\amd_windows.go:140:38: undefined: unsupportedGPUs

Relevant log output


OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

No response

Originally created by @dhadialhda on GitHub (Feb 11, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9012 ### What is the issue? I compiled it on the cuda environment of Windows, sln file, and executed the command go run . When server, I directly looked for AMD's code, not CUDA's code \ollama> go run . server github.com/ollama/ollama/llama: build constraints exclude all Go files in D:\Desktop\ollama\ollama\llama # github.com/ollama/ollama/discover discover\amd_windows.go:116:33: undefined: rocmMinimumMemory discover\amd_windows.go:126:63: undefined: IGPUMemLimit discover\amd_windows.go:129:38: undefined: unsupportedGPUs discover\amd_windows.go:140:38: undefined: unsupportedGPUs ### Relevant log output ```shell ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-04 12:01:23 -05:00
Author
Owner

@wenxioy commented on GitHub (Feb 12, 2025):

My pc env is windows,GPU is Quadro P2000. Cpu :Intel.
Cmd 'cmake -B build' and 'cmake --build build' can pass.
Then 'go run . server ' can't pass:
(base) PS D:\code\go\ollama> go run . serve
github.com/ollama/ollama/llama: build constraints exclude all Go files in D:\code\go\ollama\llama

github.com/ollama/ollama/discover

discover\amd_windows.go:115:21: undefined: rocmMinimumMemory
discover\amd_windows.go:125:57: undefined: IGPUMemLimit
discover\amd_windows.go:128:29: undefined: unsupportedGPUs
discover\amd_windows.go:139:29: undefined: unsupportedGPUs
(base) PS D:\code\go\ollama> go build .
github.com/ollama/ollama/llama: build constraints exclude all Go files in D:\code\go\ollama\llama

github.com/ollama/ollama/discover

discover\amd_windows.go:115:21: undefined: rocmMinimumMemory
discover\amd_windows.go:125:57: undefined: IGPUMemLimit
discover\amd_windows.go:128:29: undefined: unsupportedGPUs
discover\amd_windows.go:139:29: undefined: unsupportedGPUs

nvidia-smi
Wed Feb 12 16:25:55 2025
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 537.13 Driver Version: 537.13 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 Quadro P2000 WDDM | 00000000:02:00.0 On | N/A |
| 46% 34C P8 8W / 75W | 2193MiB / 5120MiB | 10% Default |
| | | N/A |

<!-- gh-comment-id:2652986739 --> @wenxioy commented on GitHub (Feb 12, 2025): My pc env is windows,GPU is Quadro P2000. Cpu :Intel. Cmd 'cmake -B build' and 'cmake --build build' can pass. Then 'go run . server ' can't pass: (base) PS D:\code\go\ollama> go run . serve github.com/ollama/ollama/llama: build constraints exclude all Go files in D:\code\go\ollama\llama # github.com/ollama/ollama/discover discover\amd_windows.go:115:21: undefined: rocmMinimumMemory discover\amd_windows.go:125:57: undefined: IGPUMemLimit discover\amd_windows.go:128:29: undefined: unsupportedGPUs discover\amd_windows.go:139:29: undefined: unsupportedGPUs (base) PS D:\code\go\ollama> go build . github.com/ollama/ollama/llama: build constraints exclude all Go files in D:\code\go\ollama\llama # github.com/ollama/ollama/discover discover\amd_windows.go:115:21: undefined: rocmMinimumMemory discover\amd_windows.go:125:57: undefined: IGPUMemLimit discover\amd_windows.go:128:29: undefined: unsupportedGPUs discover\amd_windows.go:139:29: undefined: unsupportedGPUs nvidia-smi Wed Feb 12 16:25:55 2025 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 537.13 Driver Version: 537.13 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ | GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 Quadro P2000 WDDM | 00000000:02:00.0 On | N/A | | 46% 34C P8 8W / 75W | 2193MiB / 5120MiB | 10% Default | | | | N/A |
Author
Owner

@termsofservice212 commented on GitHub (Mar 14, 2025):

Getting the same problem here too. Just compiled today with 1. Cmake 2. Visual Studio 2022 3. CUDA toolkit on a laptop with 1050. I'll dig into the code next week. Swamped.

C:\Users\user\Desktop\Projects\ollama-main>go run . serve
github.com/ollama/ollama/llama: build constraints exclude all Go files in C:\Users\user\Desktop\Projects\ollama-main\llama
# github.com/ollama/ollama/discover
discover\amd_windows.go:115:21: undefined: rocmMinimumMemory
discover\amd_windows.go:125:57: undefined: IGPUMemLimit
discover\amd_windows.go:128:29: undefined: unsupportedGPUs
discover\amd_windows.go:139:29: undefined: unsupportedGPUs
<!-- gh-comment-id:2723165889 --> @termsofservice212 commented on GitHub (Mar 14, 2025): Getting the same problem here too. Just compiled today with 1. Cmake 2. Visual Studio 2022 3. CUDA toolkit on a laptop with 1050. I'll dig into the code next week. Swamped. ``` C:\Users\user\Desktop\Projects\ollama-main>go run . serve github.com/ollama/ollama/llama: build constraints exclude all Go files in C:\Users\user\Desktop\Projects\ollama-main\llama # github.com/ollama/ollama/discover discover\amd_windows.go:115:21: undefined: rocmMinimumMemory discover\amd_windows.go:125:57: undefined: IGPUMemLimit discover\amd_windows.go:128:29: undefined: unsupportedGPUs discover\amd_windows.go:139:29: undefined: unsupportedGPUs ```
Author
Owner

@z503951608 commented on GitHub (Mar 21, 2025):

Is the problem solved?

<!-- gh-comment-id:2742607743 --> @z503951608 commented on GitHub (Mar 21, 2025): Is the problem solved?
Author
Owner

@dustletter commented on GitHub (Mar 23, 2025):

This happened to me and I found that I needed to install TDM-GCC (documented at the top of https://github.com/ollama/ollama/blob/main/docs/development.md, not in the Windows section).

I think the issue is Go not finding a C compiler and not enabling CGo: https://stackoverflow.com/a/75062464. So if installing GCC on its own doesn't work you may also need to add it to PATH or set CGO_ENABLED=1 and CC=gcc.
In addition you need to have that specific compiler installed. I tried using Clang from Visual Studio and gcc from w64devkit, both errored out.

<!-- gh-comment-id:2745984193 --> @dustletter commented on GitHub (Mar 23, 2025): This happened to me and I found that I needed to install TDM-GCC (documented at the top of https://github.com/ollama/ollama/blob/main/docs/development.md, not in the Windows section). I think the issue is Go not finding a C compiler and not enabling CGo: https://stackoverflow.com/a/75062464. So if installing GCC on its own doesn't work you may also need to add it to PATH or set CGO_ENABLED=1 and CC=gcc. In addition you need to have that specific compiler installed. I tried using Clang from Visual Studio and gcc from w64devkit, both errored out.
Author
Owner

@maruel commented on GitHub (Apr 9, 2025):

@dhiltgen FYI

go install github.com/ollama/ollama@latest works on macOS and linux but fails on Windows.
go1.24.1

<!-- gh-comment-id:2788019928 --> @maruel commented on GitHub (Apr 9, 2025): @dhiltgen FYI `go install github.com/ollama/ollama@latest` works on macOS and linux but fails on Windows. go1.24.1
Author
Owner

@dhiltgen commented on GitHub (Apr 9, 2025):

Ollama uses native code, and requires a gcc compiler in your path to build.

As mentioned above, please follow the instructions https://github.com/ollama/ollama/blob/main/docs/development.md#development for installing GCC on windows and make sure it is in your path, then it should build properly.

<!-- gh-comment-id:2790343015 --> @dhiltgen commented on GitHub (Apr 9, 2025): Ollama uses native code, and requires a gcc compiler in your path to build. As mentioned above, please follow the instructions https://github.com/ollama/ollama/blob/main/docs/development.md#development for installing GCC on windows and make sure it is in your path, then it should build properly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#67915