Skip to content

Commit 2d1b79f

Browse files
committed
floating-point-emulation: docker setup
1 parent 2f5c4fc commit 2d1b79f

File tree

4 files changed

+163
-0
lines changed

4 files changed

+163
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: &tutorial-name floating-point-emulation
2+
3+
x-config:
4+
dockerfile: &dockerfile tutorials/floating-point-emulation/brev/dockerfile
5+
image: &image ghcr.io/nvidia/floating-point-emulation-tutorial:brev-reorg-latest
6+
working-dir: &working-dir /accelerated-computing-hub/tutorials/floating-point-emulation/notebooks
7+
large: &large true
8+
gpu-config: &gpu-config
9+
privileged: true
10+
ulimits:
11+
memlock: -1
12+
stack: 67108864
13+
shm_size: 1g
14+
deploy:
15+
resources:
16+
reservations:
17+
devices:
18+
- driver: nvidia
19+
count: all
20+
capabilities: [gpu]
21+
common-service: &common-service
22+
pull_policy: missing
23+
volumes:
24+
- accelerated-computing-hub:/accelerated-computing-hub
25+
- /var/run/docker.sock:/var/run/docker.sock
26+
environment:
27+
BREV_ENV_ID: ${BREV_ENV_ID:-}
28+
ACH_TUTORIAL: *tutorial-name
29+
ACH_RUN_TESTS: ${ACH_RUN_TESTS:-}
30+
user: root
31+
working_dir: *working-dir
32+
persistent-service: &persistent-service
33+
depends_on:
34+
base:
35+
condition: service_completed_successfully
36+
restart: unless-stopped
37+
38+
services:
39+
base:
40+
<<: [*gpu-config, *common-service]
41+
image: *image
42+
entrypoint: ["/accelerated-computing-hub/brev/base-start.bash"]
43+
build:
44+
context: ../../..
45+
dockerfile: *dockerfile
46+
restart: "no"
47+
jupyter:
48+
<<: [*gpu-config, *common-service, *persistent-service]
49+
image: *image
50+
ports:
51+
- "0.0.0.0:8888:8888" # JupyterLab
52+
nsight:
53+
<<: [*gpu-config, *common-service, *persistent-service]
54+
image: nvcr.io/nvidia/devtools/nsight-streamer-nsys:2025.3.1
55+
entrypoint: ["/accelerated-computing-hub/brev/nsight-start.bash"]
56+
ports:
57+
- "0.0.0.0:8080:8080" # HTTP
58+
- "0.0.0.0:3478:3478" # TURN
59+
60+
volumes:
61+
accelerated-computing-hub:
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
FROM ghcr.io/pytorch/pytorch:2.9.1-cuda13.0-cudnn9-runtime
2+
3+
ENV PIP_ROOT_USER_ACTION=ignore \
4+
ACH_TUTORIAL=floating-point-emulation
5+
6+
# Copy only requirements.txt first for better Docker layer caching.
7+
COPY tutorials/${ACH_TUTORIAL}/brev/requirements.txt /opt/requirements.txt
8+
9+
RUN set -ex \
10+
&& `# Install Python packages` \
11+
&& pip install --no-cache-dir --root-user-action=ignore -r /opt/requirements.txt \
12+
&& rm -f /opt/requirements.txt \
13+
&& `# Install system packages` \
14+
&& apt-get update -y \
15+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git-lfs \
16+
&& apt-get clean -y \
17+
&& rm -rf /var/lib/apt/lists/* \
18+
&& `# Setup Bash` \
19+
&& mkdir -p ~/.local/state/._bash_history \
20+
&& `# Setup JupyterLab` \
21+
&& mkdir -p ~/.jupyter \
22+
&& ln -fs /accelerated-computing-hub/brev/jupyter-server-config.py ~/.jupyter/jupyter_server_config.py \
23+
&& mkdir -p ~/.ipython/profile_default/startup \
24+
&& ln -fs /accelerated-computing-hub/brev/ipython-startup-add-cwd-to-path.py ~/.ipython/profile_default/startup/00-add-cwd-to-path.py \
25+
&& python -m jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
26+
27+
# Install Docker
28+
RUN apt-get update -y \
29+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
30+
apt-transport-https \
31+
ca-certificates \
32+
curl \
33+
gnupg \
34+
lsb-release \
35+
&& mkdir -p /etc/apt/keyrings \
36+
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
37+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
38+
&& apt-get update -y \
39+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
40+
docker-ce \
41+
docker-ce-cli \
42+
containerd.io \
43+
docker-buildx-plugin \
44+
docker-compose-plugin \
45+
&& apt-get clean -y \
46+
&& rm -rf /var/lib/apt/lists/*
47+
48+
# Install CUDA Toolkit
49+
RUN apt-get update -y \
50+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
51+
build-essential \
52+
wget \
53+
&& wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
54+
&& dpkg -i cuda-keyring_1.1-1_all.deb \
55+
&& rm cuda-keyring_1.1-1_all.deb \
56+
&& apt-get update \
57+
&& DEBIAN_FRONTEND=noninteractive apt-get -y install cuda-toolkit-13-1
58+
59+
# Install MathDx
60+
RUN wget https://developer.nvidia.com/downloads/compute/cublasdx/redist/cublasdx/cuda13/nvidia-mathdx-25.12.1-cuda13.tar.gz \
61+
&& tar -xvf nvidia-mathdx-25.12.1-cuda13.tar.gz \
62+
&& rm nvidia-mathdx-25.12.1-cuda13.tar.gz \
63+
&& mv nvidia-mathdx-25.12.1-cuda13/nvidia/mathdx /opt/nvidia \
64+
&& rm -rf nvidia-mathdx-25.12.1-cuda13
65+
66+
COPY . /accelerated-computing-hub
67+
68+
WORKDIR /accelerated-computing-hub/tutorials/${ACH_TUTORIAL}/notebooks
69+
70+
RUN `# Setup Git` \
71+
&& git config --unset-all "http.https://github.com/.extraheader" || { code=$?; [ "$code" = 5 ] || exit "$code"; } \
72+
&& git config --global --add safe.directory "/accelerated-computing-hub"
73+
74+
ENTRYPOINT ["/accelerated-computing-hub/brev/jupyter-start.bash"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# NVMATH + CTK 13.1 + CCCL + cublas
2+
nvmath-python[dx]==0.8.*
3+
cuda-core[cu13]
4+
cuda-toolkit[cccl,nvrtc,cublas]==13.1.*
5+
nvidia-libmathdx-cu13 >=0.3.1,<0.4.0
6+
cuda-cccl[cu13]
7+
8+
# Scientific
9+
numpy
10+
scipy
11+
ssgetpy
12+
cupy-cuda13x
13+
14+
# Visualization
15+
matplotlib
16+
17+
# Jupyter
18+
jupyterlab
19+
jupyterlab-nvidia-nsight
20+
jupyterlab-execute-time
21+
ipywidgets
22+
ipykernel
23+
24+
# MPI
25+
mpi4py
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#! /bin/bash
2+
3+
nvidia-smi

0 commit comments

Comments
 (0)