forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
74 lines (57 loc) · 2.37 KB
/
Dockerfile
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
74
#---
# name: raft
# group: vectordb
# config: config.py
# requires: '>=34.1.0'
# depends: [pytorch, cmake, numba, cuda-python, cupy]
# test: test.py
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG CUDA_ARCHITECTURES
ARG RAFT_REPO=rapidsai/raft
ARG RAFT_VERSION=22.10
ARG RAFT_BRANCH=branch-${RAFT_VERSION}
ARG INSTALL_PREFIX=/usr/local
ARG BUILD_DIR=/opt/rapids
WORKDIR ${BUILD_DIR}
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
apt purge -y python3.9 libpython3.9* || echo "python3.9 not found, skipping removal" && \
ls -ll /usr/bin/python*
ADD https://api.github.com/repos/${RAFT_REPO}/git/refs/heads/${RAFT_BRANCH} /tmp/raft_version.json
RUN git clone --branch ${RAFT_BRANCH} --depth=1 https://github.com/${RAFT_REPO}
COPY patches.diff raft/
RUN cd raft && \
git apply patches.diff && \
git diff
RUN mkdir raft/cpp/build && \
cd raft/cpp/build && \
cmake \
-DBUILD_TESTS=OFF \
-DRAFT_COMPILE_LIBRARIES=ON \
#-DRAFT_COMPILE_LIBRARY=ON \
-DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
../
#RUN sed 's|__CUDACC_VER_MINOR__ < 5|__CUDACC_VER_MINOR__ < 4|' -i raft/cpp/build/_deps/cuco-src/include/cuco/detail/__config && \
# grep -i 'CUDACC' raft/cpp/build/_deps/cuco-src/include/cuco/detail/__config
RUN cd raft/cpp/build && \
make -j $(nproc) install
#RUN pip3 install --no-cache-dir --verbose 'Cython>=3'
RUN cd raft/cpp/build/_deps/rmm-src/python && \
sed -i "s|versioneer.get_version()|\"${RAFT_VERSION}\".lstrip('v')|g" setup.py && \
sed -i "s|get_versions().*|\"${RAFT_VERSION}\".lstrip('v')|g" rmm/__init__.py && \
python3 setup.py bdist_wheel --verbose && \
cp dist/rmm*.whl /opt && \
pip3 install --no-cache-dir --verbose /opt/rmm*.whl
RUN pip3 show rmm && python3 -c 'import rmm; print(rmm.__version__)'
RUN cd raft/python/pylibraft && \
sed -i "s|versioneer.get_version()|\"${RAFT_VERSION}\".lstrip('v')|g" setup.py && \
echo "__version__ = \"${RAFT_VERSION}\"" >> pylibraft/__init__.py && \
SKBUILD_CONFIG_OPTIONS="-DFIND_RAFT_CPP=ON" \
SKBUILD_BUILD_OPTIONS="-j$(nproc)" \
python3 -m pip wheel --no-build-isolation --verbose . && \
cp pylibraft*.whl /opt && \
pip3 install --no-cache-dir --verbose /opt/pylibraft*.whl
WORKDIR /
RUN pip3 show pylibraft && python3 -c 'import pylibraft; print(pylibraft.__version__)'