Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU Usage #115

Closed
zchryr opened this issue Oct 9, 2023 · 2 comments
Closed

GPU Usage #115

zchryr opened this issue Oct 9, 2023 · 2 comments

Comments

@zchryr
Copy link

zchryr commented Oct 9, 2023

Hello,

First off I'd just like to say this project is absolutely fantastic.

I'm having a bit of trouble trying to get the GPU to be used. I have a 2080 super, and I am able to see that using nvidia-smi in the container once it's up and running. However I don't ever see processes utilizing the GPU, and I only see the CPU going up to 100% usage after I ask the AI a question.

Here is my docker-compose-cuda-gguf.yml

version: '3.6'

services:
  llama-gpt-api-cuda-gguf:
    image: ghcr.io/abetlen/llama-cpp-python:latest 
    # build:
    #   context: ./cuda
    #   dockerfile: gguf.Dockerfile
    restart: on-failure
    volumes:
      - './models:/models'
      - './cuda:/cuda'
    ports:
      - 3001:8000
    environment:
      MODEL: '/models/${MODEL_NAME:-code-llama-2-13b-chat.gguf}'
      MODEL_DOWNLOAD_URL: '${MODEL_DOWNLOAD_URL:-https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGUF/resolve/main/codellama-13b-instruct.Q4_K_M.gguf}'
      N_GQA: '${N_GQA:-1}'
      USE_MLOCK: 1
    cap_add:
      - IPC_LOCK
      - SYS_RESOURCE
    command: '/bin/sh /cuda/run.sh'
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

  llama-gpt-ui:
    # TODO: Use this image instead of building from source after the next release
    image: 'ghcr.io/getumbrel/llama-gpt-ui:latest'
    # build:
    #   context: ./ui
    #   dockerfile: Dockerfile
    ports:
      - 3000:3000
    restart: on-failure
    environment:
      - 'OPENAI_API_KEY=sk-XXXXXXXXXXXXXXXXXXXX'
      - 'OPENAI_API_HOST=http://llama-gpt-api-cuda-gguf:8000'
      - 'DEFAULT_MODEL=/models/${MODEL_NAME:-code-llama-2-13b-chat.gguf}'
      - 'NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT=${DEFAULT_SYSTEM_PROMPT:-"You are a helpful and friendly AI assistant. Respond very concisely."}'
      - 'WAIT_HOSTS=llama-gpt-api-cuda-gguf:8000'
      - 'WAIT_TIMEOUT=${WAIT_TIMEOUT:-3600}'
@zchryr
Copy link
Author

zchryr commented Oct 9, 2023

And I've also tried setting n_gpu_layers to both 50 and 100, with no noticeable difference.

@zchryr zchryr closed this as completed Oct 16, 2023
@ProgrammingLife
Copy link

Have you solved this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants