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

Issue on windows WSL 2 Ubuntu docker: nvidia.com/gpu=all is not an absolute path. #9

Open
wirytiox opened this issue Feb 16, 2024 · 2 comments

Comments

@wirytiox
Copy link

i am using docker desktop and WSL and i am triying to get this to run, i installed it following the steps in the linux installation guide and i keep getting this error:

sudo docker run --rm -it \
    --device nvidia.com/gpu=all \
    -e CUDA=true \
    docker.io/metal3d/xmrig

docker: nvidia.com/gpu=all is not an absolute path.
See 'docker run --help'.

when i take out the --device nvidia.com/gpu=all i see this message CUDA disabled (/xmrig/libxmrig-cuda.so: cannot open shared object file: No such file or directory) and it keeps repeating

@wirytiox
Copy link
Author

wirytiox commented Feb 16, 2024

i also tried:
wget https://developer.download.nvidia.com/compute/cuda/12.3.2/local_installers/cuda_12.3.2_545.23.08_linux.run
sudo sh cuda_12.3.2_545.23.08_linux.run

also https://docs.nvidia.com/cuda/wsl-user-guide/index.html#getting-started-with-cuda-on-wsl-2

wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-3

it seems to instal A LOT of stuff yet still doesn't work

i also tried:

sudo docker run --name miner --rm -it\
    --gpus all \
    -e CUDA=true \
    -e POOL_URL=$POOL_URL \
    -e POOL_USER=$POOL_USER \
    -e POOL_PASS=$POOL_PASS \
    -e DONATE_LEVEL=$DONATE_LEVEL \
    -e OTHERS_OPTS="--tls" \
    -e COIN="XMR" \
    docker.io/metal3d/xmrig

and got:

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: mount error: file creation failed: /var/lib/docker/overlay2/75428c7181166d422dbf96ebf3c24f1e8bc0c73e36dfa50e7bdb7907b4efc668/merged/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1: file exists: unknown

i also chated with chatgpt and tried this:

sudo rm -f /etc/systemd/system/nvidia-container-runtime.service.d/*
sudo systemctl daemon-reload
sudo systemctl restart docker

@wirytiox
Copy link
Author

wirytiox commented Feb 16, 2024

i searched this thread and it seems related to the image: NVIDIA/nvidia-container-toolkit#289
not sure if something can be modified but i am still researching
i tried even more stuff, like building the dockerfile without the nvidia stuff:

FROM ubuntu:22.04 as build-cuda-plugin
LABEL maintainer="Patrice Ferlet <metal3d@gmail.com>"

ARG CUDA_PLUGIN_VERSION=6.17.0
RUN set -xe; \
    apt update; \
    apt install -y wget build-essential cmake automake libtool autoconf; \
    apt install -y gcc-9 g++-9; \
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100; \
    update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100; \
    wget https://github.com/xmrig/xmrig-cuda/archive/refs/tags/v${CUDA_PLUGIN_VERSION}.tar.gz; \
    tar xf v${CUDA_PLUGIN_VERSION}.tar.gz; \
    mv xmrig-cuda-${CUDA_PLUGIN_VERSION} xmrig-cuda; \
    cd xmrig-cuda; \
    mkdir build; \
    cd build; \
    cmake ..; \
    make -j $(nproc);


FROM ubuntu:22.04 as build-runner
ARG VERSION=6.20.0
LABEL maintainer="Patrice Ferlet <metal3d@gmail.com>"

RUN set -xe; \
    apt update; \
    apt install -y wget build-essential cmake automake libtool autoconf; \
    apt install -y gcc-9 g++-9; \
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100; \
    update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100; \
    rm -rf /var/lib/apt/lists/*; \
    wget https://github.com/xmrig/xmrig/archive/refs/tags/v${VERSION}.tar.gz; \
    tar xf v${VERSION}.tar.gz; \
    mv xmrig-${VERSION} /xmrig; \
    cd /xmrig; \
    mkdir build; \
    cd scripts; \
    ./build_deps.sh; \
    cd ../build; \
    cmake .. -DXMRIG_DEPS=scripts/deps; \
    make -j $(nproc);
RUN set -xe; \
    cd /xmrig; \
    cp build/xmrig /xmrig


FROM ubuntu:22.04 as runner
LABEL maintainer="Patrice Ferlet <metal3d@gmail.com>"
LABEL org.opencontainers.image.source="https://github.com/metal3d/docker-xmrig"
LABEL org.opencontainers.image.description="XMRig miner with CUDA support on Docker, Podman, Kubernetes..." 
LABEL org.opencontainers.image.licenses="MIT"
RUN set -xe; \
    mkdir /xmrig; \
    apt update; \
    apt -y install jq; \
    rm -rf /var/lib/apt/lists/*
COPY --from=build-runner /xmrig/xmrig /xmrig/xmrig
COPY --from=build-runner /xmrig/src/config.json /xmrig/config.json
COPY --from=build-cuda-plugin /xmrig-cuda/build/libxmrig-cuda.so /usr/lib64/


ENV POOL_USER="44vjAVKLTFc7jxTv5ij1ifCv2YCFe3bpTgcRyR6uKg84iyFhrCesstmWNUppRCrxCsMorTP8QKxMrD3QfgQ41zsqMgPaXY5" \
    POOL_PASS="" \
    POOL_URL="xmr.metal3d.org:8080" \
    DONATE_LEVEL=5 \
    PRIORITY=0 \
    THREADS=0 \
    PATH="/xmrig:${PATH}" \
    CUDA=false \
    CUDA_BF="" \
    ALGO="" \
    COIN=""

WORKDIR /xmrig
ADD entrypoint.sh /entrypoint.sh
WORKDIR /tmp
EXPOSE 3000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["xmrig"]

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

1 participant