diff --git a/README.md b/README.md index ef687e7..aa09765 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,23 @@ Privkey: 5JcX7HgrPxEbYKcWhtBT83L3BHcdJ8K8p8X1sNHmcJLsSyMNycZ ## How Split-key Works See the explanation in another similar [project](https://github.com/JeanLucPons/VanitySearch#how-it-works). +# CUDA Docker Image + +## Build Image +```shell +$ docker build -f docker/Dockerfile.cuda -t vanitygen-plusplus:latest . +``` + +## Running with [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/overview.html) +```shell +$ docker run -it --gpus all vanitygen-plusplus:latest 1Love +Difficulty: 4476342 +Compiling kernel, can take minutes...done! +Pattern: 1Love +Address: 1LovebbyvEuCnJoKZBXDA6kqts6Q2KG1WJ +Privkey: 5K3J3aA8XkvfdjhJcZ8BJhTUKAjYATCey9AdgahRvoxGB9gLUoD +``` + # Credit Many thanks to following projects: 1. https://github.com/samr7/vanitygen diff --git a/docker/Dockerfile.cuda b/docker/Dockerfile.cuda new file mode 100644 index 0000000..26414bf --- /dev/null +++ b/docker/Dockerfile.cuda @@ -0,0 +1,34 @@ +FROM nvidia/cuda:11.7.0-devel-ubuntu20.04 as build + +# bring in source +WORKDIR /vanitygen-plusplus +COPY . /vanitygen-plusplus + +# Build Requirements +# +# NOTE(canardleteer): I didn't have any luck getting `make test` to work, so +# have omitted `check`. +ENV DEBIAN_FRONTEND=noninteractive +RUN apt update && \ + apt install -y make gcc libssl-dev libpcre3-dev libcurl4-openssl-dev nvidia-opencl-dev && \ + rm -rf /var/lib/apt/lists/* + +# NOTE(canardleteer): `make install` target wanted. +RUN make all + +# The runtime image is approximately half the size of the `build` image. +FROM nvidia/cuda:11.7.0-runtime-ubuntu20.04 + +# NOTE(canardleteer): `libcurl4` is needed by oclvanityminer. I'd like to use +# something smaller than `nvidia-opencl-dev` if anyone has +# any suggestions. +RUN apt update && apt install -y libcurl4 nvidia-opencl-dev && rm -rf /var/lib/apt/lists/* + +COPY --from=build /vanitygen-plusplus/oclvanitygen++ /usr/bin +COPY --from=build /vanitygen-plusplus/oclvanityminer /usr/bin +COPY --from=build /vanitygen-plusplus/vanitygen++ /usr/bin +COPY --from=build /vanitygen-plusplus/keyconv /usr/bin +COPY --from=build /vanitygen-plusplus/calc_addrs.cl . + +# The other binaries are available by setting `--entrypoint` upon a `docker run`. +ENTRYPOINT ["/usr/bin/oclvanitygen++"] \ No newline at end of file