docker cuda
This commit is contained in:
59
rin/miner/Dockerfile.cuda-linux
Normal file
59
rin/miner/Dockerfile.cuda-linux
Normal file
@@ -0,0 +1,59 @@
|
||||
# Dockerfile for building RinHash CUDA implementation on Linux
|
||||
FROM nvidia/cuda:12.2-devel-ubuntu22.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install build tools and dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
wget \
|
||||
curl \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create build directory
|
||||
WORKDIR /build
|
||||
|
||||
# Copy source files
|
||||
COPY gpu/RinHash-cuda/ /build/
|
||||
|
||||
# Build the CUDA implementation
|
||||
RUN mkdir -p bin && \
|
||||
nvcc -O3 -std=c++11 \
|
||||
-arch=sm_50 \
|
||||
-gencode arch=compute_50,code=sm_50 \
|
||||
-gencode arch=compute_52,code=sm_52 \
|
||||
-gencode arch=compute_60,code=sm_60 \
|
||||
-gencode arch=compute_61,code=sm_61 \
|
||||
-gencode arch=compute_70,code=sm_70 \
|
||||
-gencode arch=compute_75,code=sm_75 \
|
||||
-gencode arch=compute_80,code=sm_80 \
|
||||
-gencode arch=compute_86,code=sm_86 \
|
||||
-I. \
|
||||
rinhash.cu sha3-256.cu \
|
||||
-o bin/rinhash-cuda-miner \
|
||||
-lcuda -lcudart
|
||||
|
||||
# Build test program
|
||||
RUN nvcc -O3 -std=c++11 \
|
||||
-arch=sm_50 \
|
||||
-gencode arch=compute_50,code=sm_50 \
|
||||
-gencode arch=compute_52,code=sm_52 \
|
||||
-gencode arch=compute_60,code=sm_60 \
|
||||
-gencode arch=compute_61,code=sm_61 \
|
||||
-gencode arch=compute_70,code=sm_70 \
|
||||
-gencode arch=compute_75,code=sm_75 \
|
||||
-gencode arch=compute_80,code=sm_80 \
|
||||
-gencode arch=compute_86,code=sm_86 \
|
||||
-I. \
|
||||
test_miner.cu rinhash.cu sha3-256.cu \
|
||||
-o bin/test_miner \
|
||||
-lcuda -lcudart
|
||||
|
||||
# Create output directory for built binaries
|
||||
RUN mkdir -p /output
|
||||
|
||||
# Default command to copy binaries to output
|
||||
CMD ["sh", "-c", "cp bin/* /output/ && echo 'Build completed successfully! Binaries copied to /output/'"]
|
||||
Reference in New Issue
Block a user