[GH-ISSUE #904] centos8 use gpu #26199

Closed
opened 2026-04-22 02:15:27 -05:00 by GiteaMirror · 9 comments
Owner

Originally created by @tuoxin126 on GitHub (Oct 25, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/904

How to make my Centos8 system call GPU. Currently, Ollama can be used, but it calls the CPU. Running olama run llama2 chinese: 13b chat fp16 can directly reply. There is no process for selecting a GPU. I couldn't find the corresponding parameter by looking at the help.
From langchain.llms import Ollama
Llm=Ollama (model="llama2 chinese: 13b chat fp16")
While True:
#Receive user input
Input_ Text=input ("Please enter text (enter 'exit' to exit):")
#Check if you want to exit the loop
If input_ Text. lower()=='exit ':
Break
#Using the predict() method to generate text
Res=llm. predict (input_text)
#Print generated text
Print (res)
Using Python code for testing without selecting the location of the GPU, who knows how to call the GPU
. thanks

Originally created by @tuoxin126 on GitHub (Oct 25, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/904 How to make my Centos8 system call GPU. Currently, Ollama can be used, but it calls the CPU. Running olama run llama2 chinese: 13b chat fp16 can directly reply. There is no process for selecting a GPU. I couldn't find the corresponding parameter by looking at the help. From langchain.llms import Ollama Llm=Ollama (model="llama2 chinese: 13b chat fp16") While True: #Receive user input Input_ Text=input ("Please enter text (enter 'exit' to exit):") #Check if you want to exit the loop If input_ Text. lower()=='exit ': Break #Using the predict() method to generate text Res=llm. predict (input_text) #Print generated text Print (res) Using Python code for testing without selecting the location of the GPU, who knows how to call the GPU . thanks
GiteaMirror added the bug label 2026-04-22 02:15:27 -05:00
Author
Owner

@mchiang0610 commented on GitHub (Oct 25, 2023):

@tuoxin126 may I ask what are your system specs to help us look into this?

<!-- gh-comment-id:1779795393 --> @mchiang0610 commented on GitHub (Oct 25, 2023): @tuoxin126 may I ask what are your system specs to help us look into this?
Author
Owner

@tuoxin126 commented on GitHub (Oct 26, 2023):

@tuoxin126 may I ask what are your system specs to help us look into this?

CentOS Linux release 8.5.2111
Cuda compilation tools, release 11.7, V11.7.64
ollama version 0.1.3

Other algorithm models can call GPU

<!-- gh-comment-id:1780275136 --> @tuoxin126 commented on GitHub (Oct 26, 2023): > @tuoxin126 may I ask what are your system specs to help us look into this? CentOS Linux release 8.5.2111 Cuda compilation tools, release 11.7, V11.7.64 ollama version 0.1.3 Other algorithm models can call GPU
Author
Owner

@tuoxin126 commented on GitHub (Oct 26, 2023):

Ollama

Is it necessary to use Ollama in Docker to use GPU?
No matter how configured, it cannot run on GPU directly under Linux, right?
I hope to dispel doubts. Hard work

<!-- gh-comment-id:1780535207 --> @tuoxin126 commented on GitHub (Oct 26, 2023): > Ollama Is it necessary to use Ollama in Docker to use GPU? No matter how configured, it cannot run on GPU directly under Linux, right? I hope to dispel doubts. Hard work
Author
Owner

@technovangelist commented on GitHub (Oct 27, 2023):

No requirement for docker on Linux. Some just choose to use docker. What gpu do you have?

<!-- gh-comment-id:1782296371 --> @technovangelist commented on GitHub (Oct 27, 2023): No requirement for docker on Linux. Some just choose to use docker. What gpu do you have?
Author
Owner

@tuoxin126 commented on GitHub (Oct 27, 2023):

No requirement for docker on Linux. Some just choose to use docker. What gpu do you have?

NVIDIA A100-SXM

<!-- gh-comment-id:1782306912 --> @tuoxin126 commented on GitHub (Oct 27, 2023): > No requirement for docker on Linux. Some just choose to use docker. What gpu do you have? NVIDIA A100-SXM
Author
Owner

@tuoxin126 commented on GitHub (Oct 27, 2023):

No requirement for docker on Linux. Some just choose to use docker. What gpu do you have?

No requirement for docker on Linux. Some just choose to use docker. What gpu do you have?

Thank you for your clarification

<!-- gh-comment-id:1782307243 --> @tuoxin126 commented on GitHub (Oct 27, 2023): > No requirement for docker on Linux. Some just choose to use docker. What gpu do you have? > No requirement for docker on Linux. Some just choose to use docker. What gpu do you have? Thank you for your clarification
Author
Owner

@jmorganca commented on GitHub (Oct 30, 2023):

Hi @tuoxin126 . Ollama should use the GPU by default. Here's a few things you can try:

  • Make sure nvidia drivers are installed. Running nvidia-smi should work.
  • Try running ollama run <model>. Does this use the GPU?

The Linux installer script will install Nvidia drivers if they aren't installed yet:

curl https://ollama.ai/install.sh | sh

If not it may be something we can look into further to help debug 😊 . I'll close this issue for now but please re-open if above doesn't help

<!-- gh-comment-id:1786120719 --> @jmorganca commented on GitHub (Oct 30, 2023): Hi @tuoxin126 . Ollama should use the GPU by default. Here's a few things you can try: * Make sure nvidia drivers are installed. Running `nvidia-smi` should work. * Try running `ollama run <model>`. Does this use the GPU? The Linux installer script will install Nvidia drivers if they aren't installed yet: ``` curl https://ollama.ai/install.sh | sh ``` If not it may be something we can look into further to help debug 😊 . I'll close this issue for now but please re-open if above doesn't help
Author
Owner

@tuoxin126 commented on GitHub (Oct 31, 2023):

  • ollama run

Sorry for my question. In Ollama run mode, GPU can be used, so what is the problem with my Python code. It does not use a GPU.

<!-- gh-comment-id:1786281779 --> @tuoxin126 commented on GitHub (Oct 31, 2023): > * ollama run Sorry for my question. In Ollama run mode, GPU can be used, so what is the problem with my Python code. It does not use a GPU.
Author
Owner

@tuoxin126 commented on GitHub (Oct 31, 2023):

Hi @tuoxin126 . Ollama should use the GPU by default. Here's a few things you can try:

  • Make sure nvidia drivers are installed. Running nvidia-smi should work.
  • Try running ollama run <model>. Does this use the GPU?

The Linux installer script will install Nvidia drivers if they aren't installed yet:

curl https://ollama.ai/install.sh | sh

If not it may be something we can look into further to help debug 😊 . I'll close this issue for now but please re-open if above doesn't help

GPU can be used through curl. Thank you for your reply

<!-- gh-comment-id:1786455211 --> @tuoxin126 commented on GitHub (Oct 31, 2023): > Hi @tuoxin126 . Ollama should use the GPU by default. Here's a few things you can try: > > * Make sure nvidia drivers are installed. Running `nvidia-smi` should work. > * Try running `ollama run <model>`. Does this use the GPU? > > The Linux installer script will install Nvidia drivers if they aren't installed yet: > > ``` > curl https://ollama.ai/install.sh | sh > ``` > > If not it may be something we can look into further to help debug 😊 . I'll close this issue for now but please re-open if above doesn't help GPU can be used through curl. Thank you for your reply
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#26199