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

LLamaSharp v0.15.0 broke cuda backend #909

Open
SymoHTL opened this issue Aug 28, 2024 · 15 comments
Open

LLamaSharp v0.15.0 broke cuda backend #909

SymoHTL opened this issue Aug 28, 2024 · 15 comments

Comments

@SymoHTL
Copy link

SymoHTL commented Aug 28, 2024

Description

i have a linux server with a Quadro RTX4000, i have installed drivers, my app runs in a docker container as base image i used:
FROM nvidia/cuda:12.5.0-runtime-ubuntu22.04 AS base
in v0.13.0 it worked with gguf models and gpu support, but now i wanted to run it with LLama3.1 so i need to upgrade to v0.15.0 after upgrading it cant load the library anymore, if i install only the cpu backend it works but well my server has a gpu for a reason

Edit: full error

@martindevans
Copy link
Member

Can you try testing with the current master branch? We've just merged in new binaries which will be the 0.16.0 release soon.

@SymoHTL
Copy link
Author

SymoHTL commented Aug 28, 2024

how can i do that

@martindevans
Copy link
Member

Just clone this repo and build an application to run in your server environment (e.g. one of the examples).

@SymoHTL
Copy link
Author

SymoHTL commented Aug 28, 2024

so just run an example? is it preconfigured with cuda?

@martindevans
Copy link
Member

By default the examples have WithCuda() called in the initial setup (see here).

@SymoHTL
Copy link
Author

SymoHTL commented Aug 28, 2024

hmm, i tried code assistant but it ran on gpu
image

Edit: wait, i dont have cuda installed, only in the docker container

@SymoHTL
Copy link
Author

SymoHTL commented Aug 28, 2024

ok now the gpu is working, but just at like 25%, how can i now test the master branch in my app?

@aropb
Copy link

aropb commented Aug 28, 2024

@martindevans
Please fix this bug in release 0.16.0:
#891

Otherwise, I'll stay on 0.13.0 and KM 0.62.240605.1 :)

@SymoHTL
Copy link
Author

SymoHTL commented Aug 28, 2024

why are you tagging him here for another issue?

@martindevans
Copy link
Member

Please fix this bug in release

It's an open source project, issues will get fixed when someone who wants them fixed puts in the work!

how can i now test the master branch in my app?

Easiest way is probably to remove the nuget reference from your main project, and add a reference to your cloned copy of LLamaSharp.

@aropb
Copy link

aropb commented Aug 28, 2024

I'm sorry if I broke the rules.

@SymoHTL
Copy link
Author

SymoHTL commented Aug 28, 2024

when will v0.16.0 be released?

@martindevans
Copy link
Member

Hopefully this weekend. I'm going to be busy for the rest of September so I want to get it released before then if possible.

@SymoHTL
Copy link
Author

SymoHTL commented Sep 3, 2024

hmm it is running now on 0.16.0 but its not working in docker, it works fine without it tho, are the libraries maybe not copied correctly?

edit:
my docker image is the nvidia one set up with cuda
compose also redirects the gpu


# Install .NET dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    wget \
    apt-transport-https && \
    wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
    dpkg -i packages-microsoft-prod.deb && \
    apt-get update && \
    apt-get install -y --no-install-recommends \
    aspnetcore-runtime-8.0 \
    libxml2 && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["WebUi/WebUi.csproj", "WebUi/"]
COPY ["Infrastructure/Infrastructure.csproj", "Infrastructure/"]
COPY ["Application/Application.csproj", "Application/"]
COPY ["Domain/Domain.csproj", "Domain/"]
RUN dotnet restore "WebUi/WebUi.csproj"
COPY . .
WORKDIR "/src/WebUi"
RUN dotnet build "WebUi.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "WebUi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .

ENTRYPOINT ["dotnet", "WebUi.dll"]

image

@martindevans
Copy link
Member

I don't personally know much about docker, but I know some people have reported issues before with the binaries not loading in certain docker environments. In those cases I think it was due to missing dependencies.

Try cloning llama.cpp inside the container and compiling it, then using those binaries (ensure you use exactly the right version, see the bottom of the readme).

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

3 participants