Skip to content

Instantly share code, notes, and snippets.

@maltempi
Last active November 4, 2022 16:27
Show Gist options
  • Save maltempi/7243febe288a9bd17cbad239ec98b78c to your computer and use it in GitHub Desktop.
Save maltempi/7243febe288a9bd17cbad239ec98b78c to your computer and use it in GitHub Desktop.
Building szcompressor/cuSZ on Docker container

Building

# Host machine
git clone https://github.com/szcompressor/cuSZ.git

# Host machine
docker run -it --gpus all --env NVIDIA_DISABLE_REQUIRE=1 -v $PWD/cuSZ:/cusz maltempi/cusz-dev-build /bin/bash

# Example architectures (";"-separated when specifying)
#   Volta        : 70
#   Turing       : 75
#   Ampere       : 80 86
#   Ada Lovelace : 89 (as of CUDA 11.8)
#   Hopper       : 90 (as of CUDA 11.8)
cmake .. -DCUSZ_BUILD_EXAMPLES=on \
    -DCMAKE_BUILD_TYPE=Release \
    -DCUSZ_BUILD_TESTS=on \
    -DCMAKE_CUDA_ARCHITECTURES="75;80;86" \
    -DCMAKE_INSTALL_PREFIX=[/path/to/install/dir]
make -j8

# Install to [/path/to/install/dir]
make install
# An optional testcase run can be done using `ctest`.

Running examples

Original commands

export PATH=$(pwd)/bin:$PATH               ## specify the path temporarily
cd data && sh ./sh.get-sample-data         ## download sample data
CESM=$(pwd)/cesm-CLDHGH-3600x1800 EB=1e-4
cusz -t f32 -m r2r -e ${EB} -i ${CESM} -l 3600x1800 -z --report time
cusz -i ${CESM}.cusza -x --compare ${CESM} --report time
FROM nvidia/cuda:11.7.0-devel-ubuntu22.04
RUN apt-get update && \
apt-get install -y \
make=4.3-4.1build1 \
cmake=3.22.1-1ubuntu1 \
ninja-build=1.10.1-1 \
g++=4:11.2.0-1ubuntu1 \
ninja-build=1.10.1-1 \
vim \
python3 \
wget
ENV CPLUS_INCLUDE_PATH=/usr/local/cuda/include:$CPLUS_INCLUDE_PATH
ENV C_INCLUDE_PATH=/usr/local/cuda/include:$C_INCLUDE_PATH
WORKDIR /cusz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment