From edd1e4c123802b2118632d886d58a60214fec295 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Mon, 6 May 2024 18:17:15 +0100 Subject: [PATCH] fix tensorflow version --- DockerfileServer | 37 +++++++++++++++++++++++++++++++++++++ requirements.txt | 5 +++++ run.sh | 2 ++ 3 files changed, 44 insertions(+) create mode 100644 DockerfileServer create mode 100644 requirements.txt create mode 100755 run.sh diff --git a/DockerfileServer b/DockerfileServer new file mode 100644 index 0000000..ee8f480 --- /dev/null +++ b/DockerfileServer @@ -0,0 +1,37 @@ +FROM docker.io/nvidia/cuda:12.3.2-devel-ubuntu22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +# Sometimes you have to get update twice because ? +RUN apt-get update +RUN apt-get update + +RUN apt-get install -y wget unzip python3-pip vim python3 python3-pip curl + +RUN wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz +RUN tar -xvf go1.22.2.linux-amd64.tar.gz -C /usr/local +ENV PATH=$PATH:/usr/local/go/bin +ENV GOPATH=/go + +RUN bash -c 'curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz" | tar -C /usr/local -xz' +RUN bash -c 'curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.15.0.tar.gz" | tar -C /usr/local -xz' +RUN ldconfig + +RUN ln -s /usr/bin/python3 /usr/bin/python +RUN python -m pip install nvidia-pyindex +ADD requirements.txt . +RUN python -m pip install -r requirements.txt + +ENV CUDNN_PATH=/usr/local/lib/python3.10/dist-packages/nvidia/cudnn +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.10/dist-packages/nvidia/cudnn/lib + +WORKDIR /app + +ADD go.mod . +ADD go.sum . +ADD main.go . +ADD logic logic + +RUN go install || true + +CMD ["go", "run", "."] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a4c8eec --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +tensorflow[and-cuda] == 2.15.1 +pandas +# Make sure to install the nvidia pyindex first +# nvidia-pyindex +nvidia-cudnn diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..f216200 --- /dev/null +++ b/run.sh @@ -0,0 +1,2 @@ +#!/bin/bash +podman run --rm --network host --gpus all --name fyp-server -it -v $(pwd):/app -e "TERM=xterm-256color" fyp-server bash