[GH-ISSUE #7479] 请问,我想让ollama每次调用模型的时候,默认全部加载到GPU,有什么办法吗? #51266

Closed
opened 2026-04-28 19:06:52 -05:00 by GiteaMirror · 34 comments
Owner

Originally created by @fg2501 on GitHub (Nov 3, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7479

What is the issue?

fe3abf5e-4911-4713-86c8-8f669ba9f838
每次调用的时候,经常会出现,GPU调用不到百分百,有时候一半CPU,一般GPU,有的时候甚至全部调用CPU,有办法强制只调用GPU吗?
还有,加载的GPU,默认5分钟之后卸载,我能改成10分钟之后再卸载,或者使其一直处于加载状态吗?

OS

Windows

GPU

Nvidia

CPU

AMD

Ollama version

0.1.29

Originally created by @fg2501 on GitHub (Nov 3, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7479 ### What is the issue? ![fe3abf5e-4911-4713-86c8-8f669ba9f838](https://github.com/user-attachments/assets/03427162-b4e6-4af9-ba3f-a46c94899a5c) 每次调用的时候,经常会出现,GPU调用不到百分百,有时候一半CPU,一般GPU,有的时候甚至全部调用CPU,有办法强制只调用GPU吗? 还有,加载的GPU,默认5分钟之后卸载,我能改成10分钟之后再卸载,或者使其一直处于加载状态吗? ### OS Windows ### GPU Nvidia ### CPU AMD ### Ollama version 0.1.29
GiteaMirror added the question label 2026-04-28 19:06:52 -05:00
Author
Owner

@rick-github commented on GitHub (Nov 3, 2024):

Set OLLAMA_KEEP_ALIVE=-1 to stop the model from being unloaded.

ollama uses as much of the GPU as it can. If the GPU is full, part of the model will be run in CPU. If you want to run a model only in GPU, use a smaller model or get a bigger GPU.

<!-- gh-comment-id:2453405177 --> @rick-github commented on GitHub (Nov 3, 2024): Set [`OLLAMA_KEEP_ALIVE=-1`](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-keep-a-model-loaded-in-memory-or-make-it-unload-immediately) to stop the model from being unloaded. ollama uses as much of the GPU as it can. If the GPU is full, part of the model will be run in CPU. If you want to run a model only in GPU, use a smaller model or get a bigger GPU.
Author
Owner

@fg2501 commented on GitHub (Nov 4, 2024):

设置 OLLAMA_KEEP_ALIVE=-1 以阻止模型被卸载。

奥拉马尽可能使用 GPU。如果 GPU 已满,部分模型将在 CPU 上运行。如果您只想在 GPU 上运行模型,请使用更小的模型或购买更大的 GPU。

好的,非常感谢!关键是,在GPU没满的情况,ollama有的时候,照样会只调用CPU啊,如果是尽可能的调用GPU,那我就不问了。

<!-- gh-comment-id:2453801192 --> @fg2501 commented on GitHub (Nov 4, 2024): > 设置 `OLLAMA_KEEP_ALIVE=-1` 以阻止模型被卸载。 > > 奥拉马尽可能使用 GPU。如果 GPU 已满,部分模型将在 CPU 上运行。如果您只想在 GPU 上运行模型,请使用更小的模型或购买更大的 GPU。 好的,非常感谢!关键是,在GPU没满的情况,ollama有的时候,照样会只调用CPU啊,如果是尽可能的调用GPU,那我就不问了。
Author
Owner

@rick-github commented on GitHub (Nov 4, 2024):

ollama uses as much of the GPU as it can.
whatever doesn't fit in the GPU will run on the CPU.
a model is a series of layers. the layers are processed sequentially.
operations on the GPU will run faster than operations on the CPU.
because operations on GPU are faster, more time is spent in CPU operations.
the GPU is idle while waiting for the CPU operations to complete.
ollama calls the GPU as much as it can, but the bottleneck is the CPU.
if you want the GPU to be used 100%, use a model that fits in the GPU.

<!-- gh-comment-id:2455205355 --> @rick-github commented on GitHub (Nov 4, 2024): ollama uses as much of the GPU as it can. whatever doesn't fit in the GPU will run on the CPU. a model is a series of layers. the layers are processed sequentially. operations on the GPU will run faster than operations on the CPU. because operations on GPU are faster, more time is spent in CPU operations. the GPU is idle while waiting for the CPU operations to complete. ollama calls the GPU as much as it can, but the bottleneck is the CPU. if you want the GPU to be used 100%, use a model that fits in the GPU.
Author
Owner

@fg2501 commented on GitHub (Nov 6, 2024):

奥拉马尽可能多地使用 GPU。什么不适合在 GPU 上运行的,就会在 CPU 上运行。模型是一系列层。层是按顺序处理的。GPU 上的操作将比 CPU 上的操作运行得更快。因为 GPU 上的操作更快,所以在 CPU 操作上花费的时间更多。GPU 在等待 CPU 操作完成时处于空闲状态。GPU 被 ollama 调用得越多,瓶颈就在 CPU。如果你想让 GPU 使用率达到 100%,请使用适合 GPU 的模型。

Uploading aa28b43a-fa54-4521-bdc6-d1f67bf7028e.png…
我注意到一个现象,就是我有一个模型,他是4b的模型,模型文件只有8G,但是却在加载的时候,显示为39G的大小,请问,这是什么原因呢?这个模型原本的名字叫minicpm3,是面壁智能下的模型。

<!-- gh-comment-id:2458742285 --> @fg2501 commented on GitHub (Nov 6, 2024): > 奥拉马尽可能多地使用 GPU。什么不适合在 GPU 上运行的,就会在 CPU 上运行。模型是一系列层。层是按顺序处理的。GPU 上的操作将比 CPU 上的操作运行得更快。因为 GPU 上的操作更快,所以在 CPU 操作上花费的时间更多。GPU 在等待 CPU 操作完成时处于空闲状态。GPU 被 ollama 调用得越多,瓶颈就在 CPU。如果你想让 GPU 使用率达到 100%,请使用适合 GPU 的模型。 ![Uploading aa28b43a-fa54-4521-bdc6-d1f67bf7028e.png…]() 我注意到一个现象,就是我有一个模型,他是4b的模型,模型文件只有8G,但是却在加载的时候,显示为39G的大小,请问,这是什么原因呢?这个模型原本的名字叫minicpm3,是面壁智能下的模型。
Author
Owner

@fg2501 commented on GitHub (Nov 6, 2024):

aa28b43a-fa54-4521-bdc6-d1f67bf7028e

<!-- gh-comment-id:2458742647 --> @fg2501 commented on GitHub (Nov 6, 2024): ![aa28b43a-fa54-4521-bdc6-d1f67bf7028e](https://github.com/user-attachments/assets/e3f8af1c-da92-4c84-8f4c-e37d8f462fc1)
Author
Owner

@fg2501 commented on GitHub (Nov 6, 2024):

我突然懂了,应该是我设置的上下文太长了,谢谢,这个问题我清楚了。

<!-- gh-comment-id:2458743792 --> @fg2501 commented on GitHub (Nov 6, 2024): 我突然懂了,应该是我设置的上下文太长了,谢谢,这个问题我清楚了。
Author
Owner

@fg2501 commented on GitHub (Nov 6, 2024):

我刚刚又检查了一下,这不是上下文长度的问题,算了,不搞了,我已经把这个模型卸载了。

<!-- gh-comment-id:2458747524 --> @fg2501 commented on GitHub (Nov 6, 2024): 我刚刚又检查了一下,这不是上下文长度的问题,算了,不搞了,我已经把这个模型卸载了。
Author
Owner

@morika546 commented on GitHub (Nov 6, 2024):

我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗?

<!-- gh-comment-id:2460286212 --> @morika546 commented on GitHub (Nov 6, 2024): 我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗?
Author
Owner

@fg2501 commented on GitHub (Nov 7, 2024):

我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗?

没有解决,还是这样

<!-- gh-comment-id:2462055447 --> @fg2501 commented on GitHub (Nov 7, 2024): > 我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗? 没有解决,还是这样
Author
Owner

@yzwou commented on GitHub (Nov 11, 2024):

Set OLLAMA_KEEP_ALIVE=-1 to stop the model from being unloaded.

ollama uses as much of the GPU as it can. If the GPU is full, part of the model will be run in CPU. If you want to run a model only in GPU, use a smaller model or get a bigger GPU.

我在powershell中运行set OLLAMA_KEEP_ALIVE=-1但是就算是重启了没有效果,请问如何解决?
输入ollama ps时还是会显示4 minutes from now而不是forever

<!-- gh-comment-id:2468206791 --> @yzwou commented on GitHub (Nov 11, 2024): > Set [`OLLAMA_KEEP_ALIVE=-1`](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-keep-a-model-loaded-in-memory-or-make-it-unload-immediately) to stop the model from being unloaded. > > ollama uses as much of the GPU as it can. If the GPU is full, part of the model will be run in CPU. If you want to run a model only in GPU, use a smaller model or get a bigger GPU. 我在powershell中运行set OLLAMA_KEEP_ALIVE=-1但是就算是重启了没有效果,请问如何解决? 输入ollama ps时还是会显示4 minutes from now而不是forever
Author
Owner
<!-- gh-comment-id:2468218172 --> @rick-github commented on GitHub (Nov 11, 2024): https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-windows
Author
Owner
<!-- gh-comment-id:2468222302 --> @yzwou commented on GitHub (Nov 11, 2024): > https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-windows 感谢
Author
Owner

@sudocodus commented on GitHub (Dec 1, 2024):

我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗?

你的问题解决了吗?

<!-- gh-comment-id:2509648463 --> @sudocodus commented on GitHub (Dec 1, 2024): > 我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗? 你的问题解决了吗?
Author
Owner

@fjzphch commented on GitHub (Jan 12, 2025):

我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗?

我找到解决办法了。如果使用open webui的话,可以修改高级参数里num_gpu (Ollama)的值。我用6750gre12g,9b的模型,改到30附近速度就很快,多了少了都不行。

<!-- gh-comment-id:2585704362 --> @fjzphch commented on GitHub (Jan 12, 2025): > 我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗? 我找到解决办法了。如果使用open webui的话,可以修改高级参数里num_gpu (Ollama)的值。我用6750gre12g,9b的模型,改到30附近速度就很快,多了少了都不行。
Author
Owner

@Angel0726 commented on GitHub (Feb 7, 2025):

ollama ps显示100%GPU。但是运行nvidia-smi命令查看占用情况,发现GPU占用一直为0;cpu占用为50%。模型运行速度一般,那到底占用GPU了吗?
显卡A100 40G
模型 deep-seek:32B

<!-- gh-comment-id:2642277863 --> @Angel0726 commented on GitHub (Feb 7, 2025): `ollama ps`显示100%GPU。但是运行`nvidia-smi`命令查看占用情况,发现GPU占用一直为0;cpu占用为50%。模型运行速度一般,那到底占用GPU了吗? 显卡A100 40G 模型 deep-seek:32B
Author
Owner

@hhwilliam commented on GitHub (Feb 8, 2025):

ubuntu 20.04 GPU V100 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,token生成速率还可以,ollama ps看100%GPU,但运行uptime看cpu负载飙升,怎么强制使用GPU呢请问。

<!-- gh-comment-id:2644514058 --> @hhwilliam commented on GitHub (Feb 8, 2025): ubuntu 20.04 GPU V100 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,token生成速率还可以,ollama ps看100%GPU,但运行uptime看cpu负载飙升,怎么强制使用GPU呢请问。
Author
Owner

@Angel0726 commented on GitHub (Feb 8, 2025):

ubuntu 20.04 GPU V100 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,token生成速率还可以,ollama ps看100%GPU,但运行uptime看cpu负载飙升,怎么强制使用GPU呢请问。

找到问题了。我的问题是ollama安装有问题。离线安装的

<!-- gh-comment-id:2644531920 --> @Angel0726 commented on GitHub (Feb 8, 2025): > ubuntu 20.04 GPU V100 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,token生成速率还可以,ollama ps看100%GPU,但运行uptime看cpu负载飙升,怎么强制使用GPU呢请问。 > 找到问题了。我的问题是ollama安装有问题。离线安装的
Author
Owner

@lindsaymorgan commented on GitHub (Feb 8, 2025):

ubuntu 20.04 GPU V100 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,token生成速率还可以,ollama ps看100%GPU,但运行uptime看cpu负载飙升,怎么强制使用GPU呢请问。

找到问题了。我的问题是ollama安装有问题。离线安装的

后来是怎么解决的方便介绍一下吗?我也遇到了相同的问题。

<!-- gh-comment-id:2644546014 --> @lindsaymorgan commented on GitHub (Feb 8, 2025): > > ubuntu 20.04 GPU V100 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,token生成速率还可以,ollama ps看100%GPU,但运行uptime看cpu负载飙升,怎么强制使用GPU呢请问。 > > 找到问题了。我的问题是ollama安装有问题。离线安装的 后来是怎么解决的方便介绍一下吗?我也遇到了相同的问题。
Author
Owner

@ZongXR commented on GitHub (Feb 8, 2025):

ubuntu 20.04 GPU V100 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,token生成速率还可以,ollama ps看100%GPU,但运行uptime看cpu负载飙升,怎么强制使用GPU呢请问。

找到问题了。我的问题是ollama安装有问题。离线安装的

请问怎么解决的?

<!-- gh-comment-id:2645459169 --> @ZongXR commented on GitHub (Feb 8, 2025): > > ubuntu 20.04 GPU V100 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,token生成速率还可以,ollama ps看100%GPU,但运行uptime看cpu负载飙升,怎么强制使用GPU呢请问。 > > 找到问题了。我的问题是ollama安装有问题。离线安装的 请问怎么解决的?
Author
Owner

@lumos0 commented on GitHub (Feb 13, 2025):

同样遇到此问题,未解决

<!-- gh-comment-id:2656047978 --> @lumos0 commented on GitHub (Feb 13, 2025): 同样遇到此问题,未解决
Author
Owner

@Hugo-san commented on GitHub (Feb 14, 2025):

同样遇到此问题,未解决

by updating my ollama from 0.5.7 to 0.5.10, the problem was solved for me when encountering this same problem.

<!-- gh-comment-id:2658477448 --> @Hugo-san commented on GitHub (Feb 14, 2025): > 同样遇到此问题,未解决 by updating my ollama from 0.5.7 to 0.5.10, the problem was solved for me when encountering this same problem.
Author
Owner

@lumos0 commented on GitHub (Feb 14, 2025):

同样遇到此问题,未解决

原因还是在安装上。
重装ollama后解决,之前是离线安装。重装时,按照在线安装脚本,手动修改了其中需要连网的部分,再安装后解决。

<!-- gh-comment-id:2659173465 --> @lumos0 commented on GitHub (Feb 14, 2025): > 同样遇到此问题,未解决 原因还是在安装上。 重装ollama后解决,之前是离线安装。重装时,按照[在线安装](https://ollama.com/install.sh)脚本,手动修改了其中需要连网的部分,再安装后解决。
Author
Owner

@bindianzhiyan commented on GitHub (Feb 17, 2025):

Image
有人遇到这个嘛,已经配置了负载

<!-- gh-comment-id:2661829864 --> @bindianzhiyan commented on GitHub (Feb 17, 2025): ![Image](https://github.com/user-attachments/assets/f3d16e10-f105-434d-ab2f-a08ba10b6ed9) 有人遇到这个嘛,已经配置了负载
Author
Owner

@rick-github commented on GitHub (Feb 17, 2025):

Upgrade ollama.

<!-- gh-comment-id:2662215850 --> @rick-github commented on GitHub (Feb 17, 2025): Upgrade ollama.
Author
Owner

@weeee4 commented on GitHub (Feb 18, 2025):

ubuntu 20.04 GPU T4 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,ollama ps看100%CPU。重装ollama也不能解决.请问如何处理?

<!-- gh-comment-id:2664878387 --> @weeee4 commented on GitHub (Feb 18, 2025): ubuntu 20.04 GPU T4 ,驱动版本440 CUDA版本10.2,运行deepseek-r1:7B模型时,nvidia-smi查看gpu使用率为0%,显示没有进程使用GPU资源,ollama ps看100%CPU。重装ollama也不能解决.请问如何处理?
Author
Owner

@rick-github commented on GitHub (Feb 18, 2025):

Open a new ticket, add server logs.

<!-- gh-comment-id:2664992586 --> @rick-github commented on GitHub (Feb 18, 2025): Open a new ticket, add [server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues).
Author
Owner

@sunt1009 commented on GitHub (Feb 19, 2025):

离线安装的ollama,服务器无法上网只能离线安装,目前是4张A40卡,运行的时候只使用一张卡98%,其余三张为0%,ollama版本号:0.5.11,有大佬遇到过这类问题吗?

<!-- gh-comment-id:2667409851 --> @sunt1009 commented on GitHub (Feb 19, 2025): 离线安装的ollama,服务器无法上网只能离线安装,目前是4张A40卡,运行的时候只使用一张卡98%,其余三张为0%,ollama版本号:0.5.11,有大佬遇到过这类问题吗?
Author
Owner

@cxlGiraffe commented on GitHub (Feb 19, 2025):

同样遇到此问题,未解决

原因还是在安装上。 重装ollama后解决,之前是离线安装。重装时,按照在线安装脚本,手动修改了其中需要连网的部分,再安装后解决。

大佬能分享下方法吗

<!-- gh-comment-id:2667667386 --> @cxlGiraffe commented on GitHub (Feb 19, 2025): > > 同样遇到此问题,未解决 > > 原因还是在安装上。 重装ollama后解决,之前是离线安装。重装时,按照[在线安装](https://ollama.com/install.sh)脚本,手动修改了其中需要连网的部分,再安装后解决。 大佬能分享下方法吗
Author
Owner

@rick-github commented on GitHub (Feb 19, 2025):

@sunt1009 This is normal. If the model fits on one GPU, only one GPU is used. There is no performance advantage using multiple GPUs for a single completion, see here.

<!-- gh-comment-id:2668177460 --> @rick-github commented on GitHub (Feb 19, 2025): @sunt1009 This is normal. If the model fits on one GPU, only one GPU is used. There is no performance advantage using multiple GPUs for a single completion, see [here](https://github.com/ollama/ollama/issues/7648#issuecomment-2473561990).
Author
Owner

@sunt1009 commented on GitHub (Feb 21, 2025):

@rick-github 目前现象十几个人访问,一个GPU显示100%,其余空闲,导致只有1-2个人可以访问,其余人都是等待状态,这个不正常吧!我的预期是访问一个GPU占用98%以上,后面有人发起请求理论应该使用空闲的GPU才合理吧

<!-- gh-comment-id:2673793972 --> @sunt1009 commented on GitHub (Feb 21, 2025): @rick-github 目前现象十几个人访问,一个GPU显示100%,其余空闲,导致只有1-2个人可以访问,其余人都是等待状态,这个不正常吧!我的预期是访问一个GPU占用98%以上,后面有人发起请求理论应该使用空闲的GPU才合理吧
Author
Owner

@rick-github commented on GitHub (Feb 21, 2025):

Set OLLAMA_NUM_PARALLEL to as many concurrent requests you want to handle. Or, if the model fits on one GPU, use multiple servers as I already pointed out here.

<!-- gh-comment-id:2673905383 --> @rick-github commented on GitHub (Feb 21, 2025): Set `OLLAMA_NUM_PARALLEL` to as many concurrent requests you want to handle. Or, if the model fits on one GPU, use multiple servers as I already pointed out [here](https://github.com/ollama/ollama/issues/7648#issuecomment-2473561990).
Author
Owner

@fg2501 commented on GitHub (Mar 3, 2025):

我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗?

我今天突然解决了,就是在配置文件那里增加参数,指定GPU加载多少层,PARAMETER num_gpu 100,我现在都是这样设置,这样一般来说,他都会加载满,当然,如果你的模型很大,那么,你需要再增加这个层数。

<!-- gh-comment-id:2693403374 --> @fg2501 commented on GitHub (Mar 3, 2025): > 我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗? 我今天突然解决了,就是在配置文件那里增加参数,指定GPU加载多少层,PARAMETER num_gpu 100,我现在都是这样设置,这样一般来说,他都会加载满,当然,如果你的模型很大,那么,你需要再增加这个层数。
Author
Owner

@CalunVier commented on GitHub (May 10, 2025):

我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗?

我今天突然解决了,就是在配置文件那里增加参数,指定GPU加载多少层,PARAMETER num_gpu 100,我现在都是这样设置,这样一般来说,他都会加载满,当然,如果你的模型很大,那么,你需要再增加这个层数。

您好,请问您能否说的再详细一些?

<!-- gh-comment-id:2868723468 --> @CalunVier commented on GitHub (May 10, 2025): > > 我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗? > > 我今天突然解决了,就是在配置文件那里增加参数,指定GPU加载多少层,PARAMETER num_gpu 100,我现在都是这样设置,这样一般来说,他都会加载满,当然,如果你的模型很大,那么,你需要再增加这个层数。 您好,请问您能否说的再详细一些?
Author
Owner

@LZHLZHOOO commented on GitHub (Sep 14, 2025):

我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗?

我今天突然解决了,就是在配置文件那里增加参数,指定GPU加载多少层,PARAMETER num_gpu 100,我现在都是这样设置,这样一般来说,他都会加载满,当然,如果你的模型很大,那么,你需要再增加这个层数。

遇到了同样的问题,请问具体是修改哪一个配置文件

<!-- gh-comment-id:3289264197 --> @LZHLZHOOO commented on GitHub (Sep 14, 2025): > > 我也遇到了类似的情况,但我是a卡6800xt,明明有16g专用显存,占用总显存14g的情况下,非要9g加载进共享显存,5g加载进专用显存,导致速度很慢,请问你换模型解决问题了吗? > > 我今天突然解决了,就是在配置文件那里增加参数,指定GPU加载多少层,PARAMETER num_gpu 100,我现在都是这样设置,这样一般来说,他都会加载满,当然,如果你的模型很大,那么,你需要再增加这个层数。 遇到了同样的问题,请问具体是修改哪一个配置文件
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#51266