Skip to content

Commit

Permalink
opencl docker support for nvidia GPUs
Browse files Browse the repository at this point in the history
I would love to add amd and intel aswell, but I only have an nvidia GPU
  • Loading branch information
DaniAsh551 committed Apr 7, 2023
1 parent 61b68c6 commit 3f35a84
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .docker/nvidia.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM debian:bookworm

ARG DEBIAN_FRONTEND=noninteractive
RUN apt update -y
RUN apt install -y curl \
apt-utils \
unzip \
tar \
curl \
xz-utils \
ocl-icd-libopencl1 \
opencl-headers \
clinfo \
build-essential \
gcc

RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /rustup.sh
RUN chmod +x /rustup.sh
RUN /rustup.sh -y

RUN apt install -y opencl-dev

RUN bash -c 'export LD_LIBRARY_PATH=/usr/lib:/lib:/usr/lib64:/lib64; export PATH="$PATH:$HOME/.cargo/bin";rustup default nightly'

COPY . /opt/rllama
RUN bash -c 'export PATH="$PATH:$HOME/.cargo/bin";cd /opt/rllama;RUSTFLAGS="-C target-feature=+sse2,+avx,+fma,+avx2" cargo build --release --features server'
RUN ln -s /opt/rllama/target/release/rllama /usr/bin

0 comments on commit 3f35a84

Please sign in to comment.