提交测试
This commit is contained in:
1
tools/build_requirements.txt
Normal file
1
tools/build_requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
cython==0.29.20
|
||||
9
tools/ci_requirements.txt
Normal file
9
tools/ci_requirements.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
flake8==3.7.9
|
||||
flake8-bugbear==20.1.4
|
||||
flake8-comprehensions==3.2.2
|
||||
flake8-mypy==17.8.0
|
||||
flake8-pyi==19.3.0
|
||||
pytest==7.3.0
|
||||
pytest-cov==3.0.0
|
||||
nbmake==1.4.1
|
||||
jupyter
|
||||
4
tools/doc_requirements.txt
Normal file
4
tools/doc_requirements.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
setuptools==58.0.0
|
||||
sphinx>=3.5.4,<5.1.0
|
||||
sphinx_rtd_theme==1.0.0
|
||||
urllib3<1.27,>=1.21.1
|
||||
80
tools/fixNvPe.py
Normal file
80
tools/fixNvPe.py
Normal file
@@ -0,0 +1,80 @@
|
||||
# Simple script to disable ASLR and make .nv_fatb sections read-only
|
||||
# Requires: pefile ( python -m pip install pefile )
|
||||
# Usage: fixNvPe.py --input path/to/*.dll
|
||||
|
||||
import argparse
|
||||
import pefile
|
||||
import glob
|
||||
import os
|
||||
import shutil
|
||||
|
||||
def main(args):
|
||||
failures = []
|
||||
for file in glob.glob( args.input, recursive=args.recursive ):
|
||||
print(f"\n---\nChecking {file}...")
|
||||
pe = pefile.PE(file, fast_load=True)
|
||||
nvbSect = [ section for section in pe.sections if section.Name.decode().startswith(".nv_fatb")]
|
||||
if len(nvbSect) == 1:
|
||||
sect = nvbSect[0]
|
||||
size = sect.Misc_VirtualSize
|
||||
aslr = pe.OPTIONAL_HEADER.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
|
||||
writable = 0 != ( sect.Characteristics & pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_MEM_WRITE'] )
|
||||
print(f"Found NV FatBin! Size: {size/1024/1024:0.2f}MB ASLR: {aslr} Writable: {writable}")
|
||||
if (writable or aslr) and size > 0:
|
||||
print("- Modifying DLL")
|
||||
if args.backup:
|
||||
bakFile = f"{file}_bak"
|
||||
print(f"- Backing up [{file}] -> [{bakFile}]")
|
||||
if os.path.exists( bakFile ):
|
||||
print( f"- Warning: Backup file already exists ({bakFile}), not modifying file! Delete the 'bak' to allow modification")
|
||||
failures.append( file )
|
||||
continue
|
||||
try:
|
||||
shutil.copy2( file, bakFile)
|
||||
except Exception as e:
|
||||
print( f"- Failed to create backup! [{str(e)}], not modifying file!")
|
||||
failures.append( file )
|
||||
continue
|
||||
# Disable ASLR for DLL, and disable writing for section
|
||||
pe.OPTIONAL_HEADER.DllCharacteristics &= ~pefile.DLL_CHARACTERISTICS['IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE']
|
||||
sect.Characteristics = sect.Characteristics & ~pefile.SECTION_CHARACTERISTICS['IMAGE_SCN_MEM_WRITE']
|
||||
try:
|
||||
newFile = f"{file}_mod"
|
||||
print( f"- Writing modified DLL to [{newFile}]")
|
||||
pe.write( newFile )
|
||||
pe.close()
|
||||
print( f"- Moving modified DLL to [{file}]")
|
||||
os.remove( file )
|
||||
shutil.move( newFile, file )
|
||||
except Exception as e:
|
||||
print( f"- Failed to write modified DLL! [{str(e)}]")
|
||||
failures.append( file )
|
||||
continue
|
||||
|
||||
print("\n\nDone!")
|
||||
if len(failures) > 0:
|
||||
print("***WARNING**** These files needed modification but failed: ")
|
||||
for failure in failures:
|
||||
print( f" - {failure}")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def parseArgs():
|
||||
parser = argparse.ArgumentParser( description="Disable ASLR and make .nv_fatb sections read-only", formatter_class=argparse.ArgumentDefaultsHelpFormatter )
|
||||
parser.add_argument('--input', help="Glob to parse", default="*.dll")
|
||||
parser.add_argument('--backup', help="Backup modified files", default=True, required=False)
|
||||
parser.add_argument('--recursive', '-r', default=False, action='store_true', help="Recurse into subdirectories")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
###############################
|
||||
# program entry point
|
||||
#
|
||||
if __name__ == "__main__":
|
||||
args = parseArgs()
|
||||
main( args )
|
||||
68
tools/linux/Dockerfile.base
Normal file
68
tools/linux/Dockerfile.base
Normal file
@@ -0,0 +1,68 @@
|
||||
ARG CUDA_VERSION=11.6.1
|
||||
ARG CUDNN_VERSION=8
|
||||
FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu20.04
|
||||
|
||||
ARG PYTHON_VERSION=3.8
|
||||
ENV PYTHON_VERSION=${PYTHON_VERSION}
|
||||
ARG PYTORCH_VERSION=1.13.1
|
||||
ENV PYTORCH_VERSION=${PYTORCH_VERSION}
|
||||
|
||||
RUN echo "Acquire { https::Verify-Peer false }" > /etc/apt/apt.conf.d/99verify-peer.conf \
|
||||
&& if [ -f /etc/apt/sources.list.d/cuda.list ]; then \
|
||||
rm /etc/apt/sources.list.d/cuda.list; \
|
||||
fi \
|
||||
&& if [ -f /etc/apt/sources.list.d/nvidia-ml.list ]; then \
|
||||
rm /etc/apt/sources.list.d/nvidia-ml.list; \
|
||||
fi \
|
||||
&& apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated ca-certificates \
|
||||
&& rm /etc/apt/apt.conf.d/99verify-peer.conf \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
curl \
|
||||
git \
|
||||
unzip \
|
||||
gfortran \
|
||||
libopenblas-dev \
|
||||
liblapack-dev \
|
||||
libgtk2.0-0 \
|
||||
libgtk-3-0 \
|
||||
libgbm-dev \
|
||||
libnotify-dev \
|
||||
libgconf-2-4 \
|
||||
libnss3 \
|
||||
libxss1 \
|
||||
libasound2 \
|
||||
libxtst6 \
|
||||
xauth \
|
||||
xvfb \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
|
||||
bash ~/miniconda.sh -b -p /opt/conda && \
|
||||
rm ~/miniconda.sh && \
|
||||
/opt/conda/bin/conda install -y python=${PYTHON_VERSION} && \
|
||||
/opt/conda/bin/conda clean -ya
|
||||
|
||||
ENV PATH /opt/conda/bin:$PATH
|
||||
|
||||
RUN CUDA_MAJOR="$(echo ${CUDA_VERSION} | cut -d'.' -f1)" && \
|
||||
CUDA_MINOR="$(echo ${CUDA_VERSION} | cut -d'.' -f2)" && \
|
||||
CUDA_TAG="$(echo ${CUDA_MAJOR}${CUDA_MINOR})" && \
|
||||
pip install --no-cache-dir torch==${PYTORCH_VERSION}+cu${CUDA_TAG} \
|
||||
-f https://download.pytorch.org/whl/cu${CUDA_TAG} \
|
||||
-f https://download.pytorch.org/whl/torch_stable.html
|
||||
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_16.x --insecure | bash - \
|
||||
&& apt-get install -y nodejs
|
||||
|
||||
RUN conda list > conda_build.txt
|
||||
|
||||
### Install Dash3D Requirements ###
|
||||
RUN npm install -g npm@8.5.4
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install
|
||||
57
tools/linux/Dockerfile.base_cpuonly
Normal file
57
tools/linux/Dockerfile.base_cpuonly
Normal file
@@ -0,0 +1,57 @@
|
||||
FROM ubuntu:18.04
|
||||
# used for cross-compilation in docker build
|
||||
#
|
||||
ARG PYTHON_VERSION=3.9
|
||||
ENV PYTHON_VERSION=${PYTHON_VERSION}
|
||||
ARG PYTORCH_VERSION=1.10.2
|
||||
ENV PYTORCH_VERSION=${PYTORCH_VERSION}
|
||||
|
||||
RUN echo "Acquire { https::Verify-Peer false }" > /etc/apt/apt.conf.d/99verify-peer.conf \
|
||||
&& apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated ca-certificates \
|
||||
&& rm /etc/apt/apt.conf.d/99verify-peer.conf \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
curl \
|
||||
git \
|
||||
unzip \
|
||||
gfortran \
|
||||
libopenblas-dev \
|
||||
liblapack-dev \
|
||||
libgtk2.0-0 \
|
||||
libgtk-3-0 \
|
||||
libgbm-dev \
|
||||
libnotify-dev \
|
||||
libgconf-2-4 \
|
||||
libnss3 \
|
||||
libxss1 \
|
||||
libasound2 \
|
||||
libxtst6 \
|
||||
xauth \
|
||||
xvfb \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
|
||||
bash ~/miniconda.sh -b -p /opt/conda && \
|
||||
rm ~/miniconda.sh && \
|
||||
/opt/conda/bin/conda install -y python=${PYTHON_VERSION} && \
|
||||
/opt/conda/bin/conda clean -ya
|
||||
|
||||
ENV PATH /opt/conda/bin:$PATH
|
||||
|
||||
RUN pip install --no-cache-dir torch==${PYTORCH_VERSION}+cpu \
|
||||
-f https://download.pytorch.org/whl/torch_stable.html
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_16.x --insecure | bash -
|
||||
RUN apt-get install -y nodejs
|
||||
|
||||
RUN conda list > conda_build.txt
|
||||
|
||||
### Install Dash3D Requirements ###
|
||||
RUN npm install -g npm@8.5.4
|
||||
COPY package.json package-lock.json ./
|
||||
RUN chown -R root package.json package-lock.json
|
||||
RUN npm install
|
||||
82
tools/linux/Dockerfile.install
Normal file
82
tools/linux/Dockerfile.install
Normal file
@@ -0,0 +1,82 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
# used for cross-compilation in docker build
|
||||
ARG FORCE_CUDA=1
|
||||
ENV FORCE_CUDA=${FORCE_CUDA}
|
||||
|
||||
RUN if [ -f /etc/apt/sources.list.d/cuda.list ]; then \
|
||||
rm /etc/apt/sources.list.d/cuda.list; \
|
||||
fi \
|
||||
&& if [ -f /etc/apt/sources.list.d/nvidia-ml.list ]; then \
|
||||
rm /etc/apt/sources.list.d/nvidia-ml.list; \
|
||||
fi
|
||||
|
||||
WORKDIR /kaolin
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN echo "Acquire { https::Verify-Peer false }" > /etc/apt/apt.conf.d/99verify-peer.conf \
|
||||
&& apt-get -y update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated ca-certificates \
|
||||
&& rm /etc/apt/apt.conf.d/99verify-peer.conf \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
libgl1-mesa-dev \
|
||||
libgles2-mesa-dev \
|
||||
libegl1-mesa-dev \
|
||||
git \
|
||||
pkg-config \
|
||||
libatk1.0-0 \
|
||||
libatk-bridge2.0-0 \
|
||||
libasound2 \
|
||||
libgtk2.0-0 \
|
||||
libgtk-3-0 \
|
||||
libnss3 \
|
||||
libglvnd0 \
|
||||
libgl1 \
|
||||
libglx0 \
|
||||
libegl1 \
|
||||
libgles2 \
|
||||
libglvnd-dev \
|
||||
curl \
|
||||
cmake \
|
||||
xvfb \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# fix for a weird pytorch bug (see: https://discuss.pytorch.org/t/not-able-to-include-cusolverdn-h/169122/5)
|
||||
ENV PATH /usr/local/cuda/bin:$PATH
|
||||
|
||||
# for GLEW
|
||||
ENV LD_LIBRARY_PATH /usr/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib:${LD_LIBRARY_PATH}
|
||||
|
||||
# nvidia-container-runtime
|
||||
ENV NVIDIA_VISIBLE_DEVICES all
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,graphics
|
||||
|
||||
## Install Dash3D Requirements ###
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_16.x --insecure | bash - \
|
||||
&& apt-get install -y nodejs
|
||||
|
||||
RUN npm install -g npm@8.5.4
|
||||
RUN npm install
|
||||
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install --no-cache-dir setuptools==58.0.0 ninja \
|
||||
imageio imageio-ffmpeg && \
|
||||
pip install --no-cache-dir \
|
||||
-r tools/viz_requirements.txt \
|
||||
-r tools/requirements.txt \
|
||||
-r tools/build_requirements.txt
|
||||
|
||||
RUN cd /tmp && \
|
||||
git clone https://github.com/NVlabs/nvdiffrast && \
|
||||
cd nvdiffrast && \
|
||||
cp ./docker/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json && \
|
||||
pip install .
|
||||
|
||||
RUN python setup.py develop
|
||||
74
tools/linux/Dockerfile.install_wheel
Normal file
74
tools/linux/Dockerfile.install_wheel
Normal file
@@ -0,0 +1,74 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
RUN if [ -f /etc/apt/sources.list.d/cuda.list ]; then \
|
||||
rm /etc/apt/sources.list.d/cuda.list; \
|
||||
fi \
|
||||
&& if [ -f /etc/apt/sources.list.d/nvidia-ml.list ]; then \
|
||||
rm /etc/apt/sources.list.d/nvidia-ml.list; \
|
||||
fi
|
||||
|
||||
WORKDIR /kaolin
|
||||
|
||||
ARG WHEEL_NAME
|
||||
|
||||
COPY ./package.json ./package-lock.json ./${WHEEL_NAME} ./
|
||||
COPY ./examples ./examples
|
||||
COPY ./sample_data ./sample_data
|
||||
COPY ./tests ./tests
|
||||
COPY ./tools ./tools
|
||||
RUN apt-get -y update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
libgl1-mesa-dev \
|
||||
libgles2-mesa-dev \
|
||||
libegl1-mesa-dev \
|
||||
git \
|
||||
pkg-config \
|
||||
libatk1.0-0 \
|
||||
libatk-bridge2.0-0 \
|
||||
libasound2 \
|
||||
libgtk2.0-0 \
|
||||
libgtk-3-0 \
|
||||
libnss3 \
|
||||
libglvnd0 \
|
||||
libgl1 \
|
||||
libglx0 \
|
||||
libegl1 \
|
||||
libgles2 \
|
||||
libglvnd-dev \
|
||||
curl \
|
||||
cmake \
|
||||
xvfb \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# for GLEW
|
||||
ENV LD_LIBRARY_PATH /usr/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib:${LD_LIBRARY_PATH}
|
||||
|
||||
# nvidia-container-runtime
|
||||
#ENV NVIDIA_VISIBLE_DEVICES all
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,graphics
|
||||
|
||||
# Default pyopengl to EGL for good headless rendering support
|
||||
ENV PYOPENGL_PLATFORM egl
|
||||
|
||||
## Install Dash3D Requirements ###
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_16.x --insecure | bash - \
|
||||
&& apt-get install -y nodejs
|
||||
|
||||
RUN npm install -g npm@8.5.4
|
||||
RUN npm install
|
||||
|
||||
RUN pip install --upgrade pip && pip install ninja
|
||||
|
||||
RUN cd /tmp && \
|
||||
git clone https://github.com/NVlabs/nvdiffrast && \
|
||||
cd nvdiffrast && \
|
||||
cp ./docker/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json && \
|
||||
pip install .
|
||||
|
||||
RUN pip install ./${WHEEL_NAME}
|
||||
175
tools/linux/run_tests.sh
Executable file
175
tools/linux/run_tests.sh
Executable file
@@ -0,0 +1,175 @@
|
||||
#!/bin/bash
|
||||
set -o nounset
|
||||
|
||||
USAGE="$0 <type of test(optional)>
|
||||
|
||||
Run some or all Kaolin tests, saving logs to file. Summary
|
||||
will be printed at the end.
|
||||
|
||||
To ensure everything passes, export variables such as:
|
||||
export KAOLIN_TEST_SHAPENETV2_PATH=/path/to/local/shapenet
|
||||
|
||||
To run all tests:
|
||||
bash $0 all
|
||||
|
||||
To run only pytest tests:
|
||||
bash $0 pytest
|
||||
|
||||
To run only notebooks:
|
||||
bash $0 notebook
|
||||
|
||||
To run only recipes:
|
||||
bash $0 recipes
|
||||
|
||||
To build the docs:
|
||||
bash $0 docs
|
||||
"
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo -e "$USAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export CLI_COLOR=1
|
||||
RED='\033[1;31m'
|
||||
GREEN='\033[1;32m'
|
||||
NOCOLOR='\033[0m'
|
||||
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
KAOLIN_ROOT=$SCRIPT_DIR/../..
|
||||
cd $KAOLIN_ROOT
|
||||
KAOLIN_ROOT=`pwd`
|
||||
|
||||
LOG_DIR=$KAOLIN_ROOT/.test_logs
|
||||
mkdir -p $LOG_DIR
|
||||
|
||||
RUN_PYTEST=0
|
||||
RUN_NOTEBOOK=0
|
||||
RUN_RECIPES=0
|
||||
BUILD_DOCS=0
|
||||
if [ $1 == "all" ]; then
|
||||
RUN_PYTEST=1
|
||||
RUN_NOTEBOOK=1
|
||||
RUN_RECIPES=1
|
||||
BUILD_DOCS=1
|
||||
elif [ $1 == "pytest" ]; then
|
||||
RUN_PYTEST=1
|
||||
elif [ $1 == "notebook" ]; then
|
||||
RUN_NOTEBOOK=1
|
||||
elif [ $1 == "recipes" ]; then
|
||||
RUN_RECIPES=1
|
||||
elif [ $1 == "docs" ]; then
|
||||
BUILD_DOCS=1
|
||||
else
|
||||
echo "$RED Unknown argument type $1 $NOCOLOR"
|
||||
echo -e "$USAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
start_test_info() {
|
||||
echo "***********************************************"
|
||||
echo " Running $1 Tests "
|
||||
echo "***********************************************"
|
||||
echo
|
||||
echo " ...running, see log: $LOG_DIR/log_$1.txt"
|
||||
}
|
||||
|
||||
STATUS=0
|
||||
end_test_info() {
|
||||
if [ $1 -ne 0 ]; then
|
||||
STATUS=1
|
||||
echo -e "$RED FAILED: $NOCOLOR $2"
|
||||
else
|
||||
echo -e "$GREEN SUCCESS: $NOCOLOR $2"
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
maybe_open_url() {
|
||||
which xdg-open
|
||||
if [ $? -eq 0 ]; then
|
||||
xdg-open $1
|
||||
fi
|
||||
}
|
||||
|
||||
PYTEST_LOG=$LOG_DIR/log_pytest.txt
|
||||
if [ $RUN_PYTEST -eq "1" ]; then
|
||||
echo "" > $PYTEST_LOG
|
||||
start_test_info "pytest"
|
||||
|
||||
CMDLINE="pytest --import-mode=importlib --cov=kaolin -s --cov-report=html --cov-report term-missing tests/python/"
|
||||
$CMDLINE >> $PYTEST_LOG 2>&1
|
||||
RES=$?
|
||||
COV_URL=".test_coverage/index.html"
|
||||
echo " HTML line-by-line test coverage available in $COV_URL"
|
||||
end_test_info $RES "$CMDLINE"
|
||||
maybe_open_url $COV_URL >> $PYTEST_LOG 2>&1
|
||||
fi
|
||||
|
||||
|
||||
NOTEBOOK_LOG=$LOG_DIR/log_notebook.txt
|
||||
if [ $RUN_NOTEBOOK -eq "1" ]; then
|
||||
echo "" > $NOTEBOOK_LOG
|
||||
start_test_info "notebook"
|
||||
|
||||
CMDLINE="pytest --nbmake --nbmake-timeout=3000 examples/**/*.ipynb"
|
||||
$CMDLINE >> $NOTEBOOK_LOG 2>&1
|
||||
|
||||
end_test_info $? "$CMDLINE"
|
||||
fi
|
||||
|
||||
RECIPES_LOG=$LOG_DIR/log_recipes.txt
|
||||
if [ $RUN_RECIPES -eq "1" ]; then
|
||||
echo "" > $RECIPES_LOG
|
||||
start_test_info "recipes"
|
||||
|
||||
NFAIL=0
|
||||
NPASS=0
|
||||
|
||||
cd $KAOLIN_ROOT/examples/recipes
|
||||
for F in $(find . -name "*.py" | grep -v "ipynb_checkpoints"); do
|
||||
|
||||
echo "Executing python $F" >> $RECIPES_LOG
|
||||
python $F >> $RECIPES_LOG 2>&1
|
||||
RES=$?
|
||||
if [ $RES -ne 0 ]; then
|
||||
echo -e "$RED failed : $NOCOLOR python $F"
|
||||
NFAIL=$((NFAIL+1))
|
||||
else
|
||||
echo -e "$GREEN success: $NOCOLOR python $F"
|
||||
NPASS=$((NPASS+1))
|
||||
fi
|
||||
done
|
||||
|
||||
end_test_info $NFAIL "python examples/recipes/**/*.py"
|
||||
fi
|
||||
|
||||
|
||||
DOCS_LOG=$LOG_DIR/log_docs.txt
|
||||
if [ $BUILD_DOCS -eq "1" ]; then
|
||||
echo "" > $DOCS_LOG
|
||||
start_test_info "docs"
|
||||
|
||||
cd $KAOLIN_ROOT
|
||||
rm -rf $KAOLIN_ROOT/docs/_build
|
||||
|
||||
echo " ...copying docs/ to build_docs/ to avoid git confusion" >> $DOCS_LOG 2>&1
|
||||
mkdir -p build_docs
|
||||
cp -r docs/* build_docs/.
|
||||
cd build_docs
|
||||
echo " ...replacing DOCS_MODULE_PATH in build_docs/kaolin_ext.py" >> $DOCS_LOG 2>&1
|
||||
sed -i 's/"docs"/"build_docs"/g' kaolin_ext.py >> $DOCS_LOG 2>&1
|
||||
|
||||
echo " ...building docs in build_docs dir" >> $DOCS_LOG 2>&1
|
||||
CMDLINE="python -m sphinx -T -E -W --keep-going -b html -d _build/doctrees -D language=en . _build/html"
|
||||
$CMDLINE >> $DOCS_LOG 2>&1
|
||||
RES=$?
|
||||
|
||||
cd $KAOLIN_ROOT
|
||||
DOCS_URL="build_docs/_build/html/index.html"
|
||||
echo " HTML written to $DOCS_URL"
|
||||
|
||||
end_test_info $RES "$CMDLINE"
|
||||
maybe_open_url $DOCS_URL >> $DOCS_LOG 2>&1
|
||||
fi
|
||||
7
tools/requirements.txt
Normal file
7
tools/requirements.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
usd-core<=23.5 ; python_version < "3.11"
|
||||
numpy
|
||||
pybind11
|
||||
Pillow>=8.0.0
|
||||
tqdm>=4.51.0
|
||||
scipy
|
||||
pygltflib
|
||||
9
tools/viz_requirements.txt
Normal file
9
tools/viz_requirements.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
ipython ; python_version >= "3.9"
|
||||
ipython < 8.13 ; python_version < "3.9"
|
||||
ipycanvas
|
||||
ipyevents
|
||||
jupyter_client<8
|
||||
pyzmq<25
|
||||
flask
|
||||
tornado
|
||||
comm>=0.1.3
|
||||
88
tools/windows/Dockerfile.base
Normal file
88
tools/windows/Dockerfile.base
Normal file
@@ -0,0 +1,88 @@
|
||||
# Note: Keep C:\Program Files (x86)\Microsoft Visual Studio\Installer directory.
|
||||
# disutils/setuptools calls vswhere.exe from that location unconditionally.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
|
||||
|
||||
# set up conda and python environment
|
||||
ARG CUDA_VERSION=11.1
|
||||
ENV CUDA_VERSION=${CUDA_VERSION}
|
||||
ARG PYTHON_VERSION=3.7
|
||||
ENV PYTHON_VERSION=${PYTHON_VERSION}
|
||||
ARG PYTORCH_VERSION=1.8
|
||||
ENV PYTORCH_VERSION=${PYTORCH_VERSION}
|
||||
ARG FORCE_CUDA=1
|
||||
ENV FORCE_CUDA=${FORCE_CUDA}
|
||||
|
||||
ARG CUDA_URL="http://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_456.81_win10.exe"
|
||||
ENV CUDA_URL=${CUDA_URL}
|
||||
ARG CUDA_FILENAME=cuda_${CUDA_VERSION}_win10.exe
|
||||
ENV CUDA_FILENAME=${CUDA_FILENAME}
|
||||
|
||||
|
||||
#### BUILD TOOLS ####
|
||||
|
||||
# pulling downloads to top to not repeat
|
||||
# download & install VS build tools 2019
|
||||
RUN Invoke-WebRequest "https://aka.ms/vs/16/release/vs_buildtools.exe" -OutFile vs_buildtools.exe -UseBasicParsing; \
|
||||
Start-Process -FilePath 'vs_buildtools.exe' -Wait -ArgumentList '--quiet', '--norestart', '--downloadThenInstall', '--nocache', '--wait', '--installPath', 'C:\BuildTools', '--add', 'Microsoft.VisualStudio.Workload.VCTools'; \
|
||||
Start-Process -FilePath 'vs_buildtools.exe' -Wait -ArgumentList '--quiet', '--norestart', '--downloadThenInstall', '--nocache', '--wait', '--installPath', 'C:\BuildTools', '--add', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64'; \
|
||||
Start-Process -FilePath 'vs_buildtools.exe' -Wait -ArgumentList '--quiet', '--norestart', '--downloadThenInstall', '--nocache', '--wait', '--installPath', 'C:\BuildTools', '--add', 'Microsoft.VisualStudio.Workload.MSBuildTools'; \
|
||||
Start-Process -FilePath 'vs_buildtools.exe' -Wait -ArgumentList '--quiet', '--norestart', '--downloadThenInstall', '--nocache', '--wait', '--installPath', 'C:\BuildTools', '--add', 'Microsoft.Component.VC.Runtime.UCRTSDK'; \
|
||||
Start-Process -FilePath 'vs_buildtools.exe' -Wait -ArgumentList '--quiet', '--norestart', '--downloadThenInstall', '--nocache', '--wait', '--installPath', 'C:\BuildTools', '--add', 'Microsoft.VisualStudio.Component.Windows10SDK.18362'; \
|
||||
Remove-Item .\vs_buildtools.exe
|
||||
|
||||
|
||||
# The msvc version (subdir) has been shown to change over time.
|
||||
# The winsdk version (subdir) may change over time either through changes by MS or our own arguments to vs_buildtools.exe above.
|
||||
# Keeping that in mind, let's dynamically pick up the paths which get created.
|
||||
RUN setx /M PATH $('c:\buildtools\vc\tools\msvc\' + $(Get-ChildItem -Path 'c:\buildtools\vc\tools\msvc' -Force -Directory | Select-Object -First 1).Name + '\bin\hostx64\x64;' \
|
||||
+ 'c:\buildtools\vc\tools\msvc\' + $(Get-ChildItem -Path 'c:\buildtools\vc\tools\msvc' -Force -Directory | Select-Object -First 1).Name + '\lib\x64;' \
|
||||
+ 'c:\buildtools\vc\tools\msvc\' + $(Get-ChildItem -Path 'c:\buildtools\vc\tools\msvc' -Force -Directory | Select-Object -First 1).Name + '\include;' \
|
||||
+ 'C:\Program Files (x86)\Windows Kits\10\bin\' + $(Get-ChildItem -Path 'C:\Program Files (x86)\Windows Kits\10\bin\' -Force -Directory | Select-Object -First 1).Name + '\x64;' \
|
||||
+ 'C:\BuildTools\VC\Auxiliary\Build;' \
|
||||
+ $Env:PATH)
|
||||
|
||||
#### CUDA ####
|
||||
|
||||
# needed:
|
||||
# nvcc
|
||||
# cusparse
|
||||
# cusparse_dev
|
||||
# cublas
|
||||
# cublas_dev
|
||||
# curand
|
||||
# curand_dev
|
||||
# cudart_11.1 # for vector_types.h
|
||||
# cusolver_11.1
|
||||
# cusolver_dev_11.1
|
||||
# cuda_thrust_11.3 # if CUDA >= 11.3, needed to build
|
||||
|
||||
# install CUDA toolkit
|
||||
# TODO: may need to add more packages or alter names for later CUDA versions...
|
||||
# CUDA 11.3+ adds 'thrust' to the set of requirements we need to install
|
||||
RUN Invoke-WebRequest $Env:CUDA_URL -OutFile $Env:CUDA_FILENAME -UseBasicParsing; \
|
||||
if ([convert]::ToDouble(${Env:CUDA_VERSION}) -ge 11.3) { Start-Process -FilePath \"$Env:CUDA_FILENAME\" -Wait -ArgumentList '-s', \"nvcc_${Env:CUDA_VERSION}\", \"cusparse_${Env:CUDA_VERSION}\", \"cusparse_dev_${Env:CUDA_VERSION}\", \"cublas_${Env:CUDA_VERSION}\", \"cublas_dev_${Env:CUDA_VERSION}\", \"curand_${Env:CUDA_VERSION}\", \"curand_dev_${Env:CUDA_VERSION}\", \"cudart_${Env:CUDA_VERSION}\", \"cusolver_${Env:CUDA_VERSION}\", \"cusolver_dev_${Env:CUDA_VERSION}\", \"thrust_${Env:CUDA_VERSION}\" } \
|
||||
else { Start-Process -FilePath \"$Env:CUDA_FILENAME\" -Wait -ArgumentList '-s', \"nvcc_${Env:CUDA_VERSION}\", \"cusparse_${Env:CUDA_VERSION}\", \"cusparse_dev_${Env:CUDA_VERSION}\", \"cublas_${Env:CUDA_VERSION}\", \"cublas_dev_${Env:CUDA_VERSION}\", \"curand_${Env:CUDA_VERSION}\", \"curand_dev_${Env:CUDA_VERSION}\", \"cudart_${Env:CUDA_VERSION}\", \"cusolver_${Env:CUDA_VERSION}\", \"cusolver_dev_${Env:CUDA_VERSION}\"; } \
|
||||
Remove-Item $Env:CUDA_FILENAME
|
||||
|
||||
# TODO: can we use conda cuda install instead? only once we need cuda 11.3.0+
|
||||
# RUN conda install -y cuda cuda-nvcc -c nvidia/label/cuda-11.3.1
|
||||
# RUN setx /M PATH $('C:\Users\Administrator\miniconda3\bin;C:\Users\Administrator\miniconda3\include;' + $Env:Path)
|
||||
|
||||
|
||||
#### ANACONDA ####
|
||||
RUN Invoke-WebRequest "https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe" -OutFile miniconda3.exe -UseBasicParsing;
|
||||
|
||||
# install conda & python packages
|
||||
# PATH must be updated before attempting to run "conda" or it will error out strangely on web requests
|
||||
RUN setx /M PATH $('C:\Users\Administrator\miniconda3\Library\bin;C:\Users\Administrator\miniconda3\Scripts;C:\Users\Administrator\miniconda3;' + $Env:PATH)
|
||||
RUN Start-Process -FilePath 'miniconda3.exe' -Wait -ArgumentList '/S', '/D=C:\Users\Administrator\miniconda3'; \
|
||||
Remove-Item .\miniconda3.exe; \
|
||||
conda install -y python=$Env:PYTHON_VERSION
|
||||
|
||||
# NOTE: update the install list (2 lines here) if SSL_CERTIFICATE errors crop up to pip install the related dependency
|
||||
RUN $Env:TORCH_STR = ${Env:PYTORCH_VERSION} + '+cu' + ${Env:CUDA_VERSION}.Replace('.',''); \
|
||||
$Env:TORCH_URL='https://download.pytorch.org/whl/cu' + ${Env:CUDA_VERSION}.Replace('.',''); \
|
||||
pip install --no-cache-dir torch==${Env:TORCH_STR} ninja --extra-index-url ${Env:TORCH_URL};
|
||||
|
||||
RUN pip install brotli
|
||||
26
tools/windows/Dockerfile.install
Normal file
26
tools/windows/Dockerfile.install
Normal file
@@ -0,0 +1,26 @@
|
||||
# Note: Keep C:\Program Files (x86)\Microsoft Visual Studio\Installer directory.
|
||||
# disutils/setuptools calls vswhere.exe from that location unconditionally.
|
||||
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
#### Kaolin ####
|
||||
|
||||
WORKDIR /kaolin
|
||||
|
||||
RUN conda list > conda_build.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
# NOTE: pin setuptools to avoid directory copy bug
|
||||
RUN pip install --upgrade --no-cache-dir setuptools==58.0.0 certifi
|
||||
RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host pypi.python.org \
|
||||
--trusted-host files.pythonhosted.org -r tools\ci_requirements.txt \
|
||||
-r tools\viz_requirements.txt -r tools\requirements.txt -r tools/build_requirements.txt
|
||||
|
||||
RUN python setup.py develop
|
||||
|
||||
# fix for paging memory issue on CI machines
|
||||
# see: https://gist.github.com/cobryan05/7d1fe28dd370e110a372c4d268dcb2e5
|
||||
RUN pip install pefile
|
||||
COPY tools/fixNvPe.py c:/data/
|
||||
17
tools/windows/Dockerfile.install_wheel
Normal file
17
tools/windows/Dockerfile.install_wheel
Normal file
@@ -0,0 +1,17 @@
|
||||
# Note: Keep C:\Program Files (x86)\Microsoft Visual Studio\Installer directory.
|
||||
# disutils/setuptools calls vswhere.exe from that location unconditionally.
|
||||
|
||||
ARG BASE_IMAGE
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
WORKDIR /kaolin
|
||||
|
||||
COPY . .
|
||||
|
||||
# NOTE: pin setuptools to avoid directory copy bug
|
||||
RUN pip install --upgrade --no-cache-dir setuptools==58.0.0 certifi
|
||||
RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host pypi.python.org \
|
||||
--trusted-host files.pythonhosted.org -r tools/build_requirements.txt
|
||||
|
||||
RUN python setup.py bdist_wheel --dist-dir .
|
||||
RUN Get-ChildItem "./" -Filter "*.whl" | Foreach-Object {$filepath=$_.FullName; pip install $filepath}
|
||||
5
tools/windows/SetupDriver.ps1
Normal file
5
tools/windows/SetupDriver.ps1
Normal file
@@ -0,0 +1,5 @@
|
||||
$Env:driver_store=$(ls $($($(Get-WmiObject Win32_VideoController).InstalledDisplayDrivers | sort -Unique).ToString().Split(',')| sort -Unique).ToString().Replace("\DriverStore\", "\HostDriverStore\")).Directory.FullName
|
||||
|
||||
cp "$Env:driver_store\nvcuda64.dll" C:\Windows\System32\nvcuda.dll
|
||||
cp "$Env:driver_store\nvapi64.dll" C:\Windows\System32\nvapi64.dll
|
||||
|
||||
6
tools/windows/Test.ps1
Normal file
6
tools/windows/Test.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
echo "******** Running Device Query ********"
|
||||
c:\data\deviceQuery.exe
|
||||
echo "******** DONE ********"
|
||||
echo "******** Running Bandwidth Test ********"
|
||||
c:\data\bandwidthTest.exe
|
||||
echo "******** DONE ********"
|
||||
BIN
tools/windows/bandwidthTest.exe
Normal file
BIN
tools/windows/bandwidthTest.exe
Normal file
Binary file not shown.
BIN
tools/windows/deviceQuery.exe
Normal file
BIN
tools/windows/deviceQuery.exe
Normal file
Binary file not shown.
2
tools/windows/main.ps1
Normal file
2
tools/windows/main.ps1
Normal file
@@ -0,0 +1,2 @@
|
||||
c:\data\SetupDriver.ps1
|
||||
c:\data\Test.ps1
|
||||
Reference in New Issue
Block a user