-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSingularity.def
More file actions
73 lines (58 loc) · 1.71 KB
/
Singularity.def
File metadata and controls
73 lines (58 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Bootstrap: docker
From: nvidia/12.2.2-runtime-ubuntu20.04
Stage: builder
%files
. .
bin/drugs /app/drugs
bin/result /app/result
bin/input_deck_example.txt /app/input_deck_example.txt
%files from builder
/app/bin/drug_sim /app/
%post
# Stage 1: Build environment with CUDA and necessary tools (Ubuntu-based)
mkdir -p /app
cd /app
# Set non-interactive environment
DEBIAN_FRONTEND=noninteractive
# Install essential build tools (Ubuntu-specific packages)
apt-get update && apt-get install -y \
make \
cmake \
nano \
libtool \
libjson-c-dev \
libcurl4-openssl-dev \
libc6-dev-i386 \
wget \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Download and install cuDNN manually
# https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/libcudnn8_8.9.5.29-1+cuda12.2_amd64.deb \
&& dpkg -i libcudnn8_8.9.5.29-1+cuda12.2_amd64.deb \
&& rm libcudnn8_8.9.5.29-1+cuda12.2_amd64.deb
# Copy project files
# Compile each project with nvcc
make
# RUN make -C project3
# Add more commands for additional projects
##------------------------------------------------------------------------------------
# Stage 2: Minimal runtime environment (Ubuntu-based)
# Use runtime to save some space, but if there any error, try to switch to devel
# FROM nvidia/cuda:12.2.2-devel-ubuntu20.04
# Install essential build tools (Ubuntu-specific packages)
apt-get update && apt install glibc-source -y
mkdir -p /app
cd /app
# Copy compiled binaries from the builder stage
# Copy files from the host machine
# Run the binary file
# CMD ["./drug_sim"]
%environment
export DEBIAN_FRONTEND=noninteractive
%runscript
cd /app
exec /bin/bash "$@"
%startscript
cd /app
exec /bin/bash "$@"