This is an automated email from the ASF dual-hosted git repository. marcoabreu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push: new 0fd2969 [MXNET-303] Update Jetpack to version 3.2 (#10482) 0fd2969 is described below commit 0fd29698a11c0c77180aefdcf8264e063158a2c0 Author: Kellen Sunderland <kellen.sunderl...@gmail.com> AuthorDate: Tue Apr 10 13:22:54 2018 +0000 [MXNET-303] Update Jetpack to version 3.2 (#10482) --- Makefile | 6 +- ci/docker/Dockerfile.build.jetson | 44 ++++----- ci/docker/runtime_functions.sh | 24 +---- make/crosscompile.jetson.mk | 196 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 224 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index ae57114..b0758e9 100644 --- a/Makefile +++ b/Makefile @@ -254,8 +254,10 @@ ifneq ($(ADD_LDFLAGS), NONE) LDFLAGS += $(ADD_LDFLAGS) endif -ifneq ($(USE_CUDA_PATH), NONE) - NVCC=$(USE_CUDA_PATH)/bin/nvcc +ifeq ($(NVCC), NONE) + ifneq ($(USE_CUDA_PATH), NONE) + NVCC=$(USE_CUDA_PATH)/bin/nvcc + endif endif # Sets 'CUDA_ARCH', which determines the GPU architectures supported diff --git a/ci/docker/Dockerfile.build.jetson b/ci/docker/Dockerfile.build.jetson index e49b48e..9fa50f4 100755 --- a/ci/docker/Dockerfile.build.jetson +++ b/ci/docker/Dockerfile.build.jetson @@ -20,53 +20,47 @@ # This script assumes /work/mxnet exists and contains the mxnet code you wish to compile and # that /work/build exists and is the target for your output. -FROM nvidia/cuda:8.0-cudnn6-devel as cudabuilder +FROM nvidia/cuda:9.0-cudnn7-devel as cudabuilder FROM dockcross/linux-arm64 ENV ARCH aarch64 -ENV NVCCFLAGS "-m64" -ENV CC /usr/bin/aarch64-linux-gnu-gcc -ENV CXX /usr/bin/aarch64-linux-gnu-g++ -ENV FC /usr/bin/aarch64-linux-gnu-gfortran-4.9 +ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran ENV HOSTCC gcc +ENV TARGET ARMV8 WORKDIR /work # Build OpenBLAS -ADD https://api.github.com/repos/xianyi/OpenBLAS/git/refs/heads/master /tmp/openblas_version.json -RUN git clone https://github.com/xianyi/OpenBLAS.git && \ +ADD https://api.github.com/repos/xianyi/OpenBLAS/git/refs/tags/v0.2.20 openblas_version.json +RUN git clone --recursive -b v0.2.20 https://github.com/xianyi/OpenBLAS.git && \ cd OpenBLAS && \ - make -j$(nproc) TARGET=ARMV8 && \ - PREFIX=/usr make install + make -j$(nproc) && \ + PREFIX=${CROSS_ROOT} make install # Setup CUDA build env (including configuring and copying nvcc) COPY --from=cudabuilder /usr/local/cuda /usr/local/cuda -ENV PATH $PATH:/usr/local/cuda/bin ENV TARGET_ARCH aarch64 ENV TARGET_OS linux -# Install ARM depedencies based on Jetpack 3.1 -RUN JETPACK_DOWNLOAD_PREFIX=http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/013/linux-x64 && \ - ARM_CUDA_INSTALLER_PACKAGE=cuda-repo-l4t-8-0-local_8.0.84-1_arm64.deb && \ - ARM_CUDNN_INSTALLER_PACKAGE=libcudnn6_6.0.21-1+cuda8.0_arm64.deb && \ - ARM_CUDNN_DEV_INSTALLER_PACKAGE=libcudnn6-dev_6.0.21-1+cuda8.0_arm64.deb && \ +# Install ARM depedencies based on Jetpack 3.2 +RUN JETPACK_DOWNLOAD_PREFIX=http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/ && \ + ARM_CUDA_INSTALLER_PACKAGE=cuda-repo-l4t-9-0-local_9.0.252-1_arm64.deb && \ + ARM_CUDNN_INSTALLER_PACKAGE=libcudnn7_7.0.5.13-1+cuda9.0_arm64.deb && \ + ARM_CUDNN_DEV_INSTALLER_PACKAGE=libcudnn7-dev_7.0.5.13-1+cuda9.0_arm64.deb && \ wget -nv $JETPACK_DOWNLOAD_PREFIX/$ARM_CUDA_INSTALLER_PACKAGE && \ wget -nv $JETPACK_DOWNLOAD_PREFIX/$ARM_CUDNN_INSTALLER_PACKAGE && \ wget -nv $JETPACK_DOWNLOAD_PREFIX/$ARM_CUDNN_DEV_INSTALLER_PACKAGE && \ dpkg -i $ARM_CUDA_INSTALLER_PACKAGE && \ + apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub && \ dpkg -i $ARM_CUDNN_INSTALLER_PACKAGE && \ dpkg -i $ARM_CUDNN_DEV_INSTALLER_PACKAGE && \ - apt update -y && \ - apt install -y unzip cuda-cudart-cross-aarch64-8-0 cuda-cublas-cross-aarch64-8-0 \ - cuda-nvml-cross-aarch64-8-0 cuda-nvrtc-cross-aarch64-8-0 cuda-cufft-cross-aarch64-8-0 \ - cuda-curand-cross-aarch64-8-0 cuda-cusolver-cross-aarch64-8-0 cuda-cusparse-cross-aarch64-8-0 \ - cuda-misc-headers-cross-aarch64-8-0 cuda-npp-cross-aarch64-8-0 libcudnn6 && \ - cp /usr/local/cuda-8.0/targets/aarch64-linux/lib/*.so /usr/local/cuda/lib64/ && \ - cp /usr/local/cuda-8.0/targets/aarch64-linux/lib/stubs/*.so /usr/local/cuda/lib64/stubs/ && \ - cp -r /usr/local/cuda-8.0/targets/aarch64-linux/include/ /usr/local/cuda/include/ && \ - rm $ARM_CUDA_INSTALLER_PACKAGE $ARM_CUDNN_INSTALLER_PACKAGE $ARM_CUDNN_DEV_INSTALLER_PACKAGE + apt update -y && apt install -y unzip cuda-libraries-dev-9-0 libcudnn7-dev -WORKDIR /work/mxnet +ENV PATH $PATH:/usr/local/cuda/bin +ENV NVCCFLAGS "-m64" +ENV CUDA_ARCH "-gencode arch=compute_53,code=sm_53 -gencode arch=compute_62,code=sm_62" +ENV NVCC /usr/local/cuda/bin/nvcc COPY runtime_functions.sh /work/ +WORKDIR /work/mxnet diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index d5a1883..484b49c 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -38,36 +38,22 @@ clean_repo() { build_jetson() { set -ex pushd . + mv make/crosscompile.jetson.mk make/config.mk + make -j$(nproc) - #cd /work/mxnet - #make -j$(nproc) USE_OPENCV=0 USE_BLAS=openblas USE_SSE=0 USE_CUDA=1 USE_CUDNN=1 ENABLE_CUDA_RTC=0 USE_NCCL=0 USE_CUDA_PATH=/usr/local/cuda/ - cd /work/build - cmake\ - -DUSE_CUDA=OFF\ - -DUSE_OPENCV=OFF\ - -DUSE_OPENMP=ON\ - -DUSE_SIGNAL_HANDLER=ON\ - -DUSE_MKL_IF_AVAILABLE=OFF\ - -DUSE_LAPACK=OFF\ - -DCMAKE_BUILD_TYPE=RelWithDebInfo\ - -G Ninja /work/mxnet - ninja export MXNET_LIBRARY_PATH=`pwd`/libmxnet.so cd /work/mxnet/python python setup.py bdist_wheel --universal - - # Fix pathing issues in the wheel. We need to move libmxnet.so from the data folder to the root - # of the wheel, then repackage the wheel. - # Create a temp dir to do the work. - # TODO: move apt call to install + # Fix pathing issues in the wheel. We need to move libmxnet.so from the data folder to the + # mxnet folder, then repackage the wheel. WHEEL=`readlink -f dist/*.whl` TMPDIR=`mktemp -d` unzip -d $TMPDIR $WHEEL rm $WHEEL cd $TMPDIR mv *.data/data/mxnet/libmxnet.so mxnet - zip -r $WHEEL $TMPDIR + zip -r $WHEEL . cp $WHEEL /work/build rm -rf $TMPDIR popd diff --git a/make/crosscompile.jetson.mk b/make/crosscompile.jetson.mk new file mode 100644 index 0000000..9ca4109 --- /dev/null +++ b/make/crosscompile.jetson.mk @@ -0,0 +1,196 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#------------------------------------------------------------------------------- +# Template configuration for compiling mxnet +# +# If you want to change the configuration, please use the following +# steps. Assume you are on the root directory of mxnet. First copy the this +# file so that any local changes will be ignored by git +# +# $ cp make/config.mk . +# +# Next modify the according entries, and then compile by +# +# $ make +# +# or build in parallel with 8 threads +# +# $ make -j8 +#------------------------------------------------------------------------------- + +#--------------------- +# For cross compilation we only explictily set a compiler when one is not already present. +#-------------------- + +ifndef CC +export CC = gcc +endif +ifndef CXX +export CXX = g++ +endif +ifndef NVCC +export NVCC = nvcc +endif + +# whether compile with options for MXNet developer +DEV = 0 + +# whether compile with debug +DEBUG = 0 + +# whether to turn on segfault signal handler to log the stack trace +USE_SIGNAL_HANDLER = 1 + +# the additional link flags you want to add +ADD_LDFLAGS = + +# the additional compile flags you want to add +ADD_CFLAGS = + +#--------------------------------------------- +# matrix computation libraries for CPU/GPU +#--------------------------------------------- + +# whether use CUDA during compile +USE_CUDA = 1 + +# add the path to CUDA library to link and compile flag +# if you have already add them to environment variable, leave it as NONE +# USE_CUDA_PATH = /usr/local/cuda +USE_CUDA_PATH = /usr/local/cuda-9.0/targets/aarch64-linux + +# whether to enable CUDA runtime compilation +ENABLE_CUDA_RTC = 0 + +# whether use CuDNN R3 library +USE_CUDNN = 1 + +#whether to use NCCL library +USE_NCCL = 0 +#add the path to NCCL library +USE_NCCL_PATH = NONE + +# whether use opencv during compilation +# you can disable it, however, you will not able to use +# imbin iterator +USE_OPENCV = 0 + +#whether use libjpeg-turbo for image decode without OpenCV wrapper +USE_LIBJPEG_TURBO = 0 +#add the path to libjpeg-turbo library +USE_LIBJPEG_TURBO_PATH = NONE + +# use openmp for parallelization +USE_OPENMP = 1 + +# whether use MKL-DNN library +USE_MKLDNN = 0 + +# whether use NNPACK library +USE_NNPACK = 0 + +# choose the version of blas you want to use +# can be: mkl, blas, atlas, openblas +# in default use atlas for linux while apple for osx +UNAME_S := $(shell uname -s) +USE_BLAS = openblas + +# whether use lapack during compilation +# only effective when compiled with blas versions openblas/apple/atlas/mkl +USE_LAPACK = 1 + +# path to lapack library in case of a non-standard installation +USE_LAPACK_PATH = + +# add path to intel library, you may need it for MKL, if you did not add the path +# to environment variable +USE_INTEL_PATH = NONE + +# If use MKL only for BLAS, choose static link automatically to allow python wrapper +ifeq ($(USE_BLAS), mkl) +USE_STATIC_MKL = 1 +else +USE_STATIC_MKL = NONE +endif + +#---------------------------- +# Settings for power and arm arch +#---------------------------- +USE_SSE=0 + +#---------------------------- +# distributed computing +#---------------------------- + +# whether or not to enable multi-machine supporting +USE_DIST_KVSTORE = 0 + +# whether or not allow to read and write HDFS directly. If yes, then hadoop is +# required +USE_HDFS = 0 + +# path to libjvm.so. required if USE_HDFS=1 +LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server + +# whether or not allow to read and write AWS S3 directly. If yes, then +# libcurl4-openssl-dev is required, it can be installed on Ubuntu by +# sudo apt-get install -y libcurl4-openssl-dev +USE_S3 = 0 + +#---------------------------- +# performance settings +#---------------------------- +# Use operator tuning +USE_OPERATOR_TUNING = 1 + +# Use gperftools if found +USE_GPERFTOOLS = 1 + +# Use JEMalloc if found, and not using gperftools +USE_JEMALLOC = 1 + +#---------------------------- +# additional operators +#---------------------------- + +# path to folders containing projects specific operators that you don't want to put in src/operators +EXTRA_OPERATORS = + +#---------------------------- +# other features +#---------------------------- + +# Create C++ interface package +USE_CPP_PACKAGE = 0 + +#---------------------------- +# plugins +#---------------------------- + +# whether to use caffe integration. This requires installing caffe. +# You also need to add CAFFE_PATH/build/lib to your LD_LIBRARY_PATH +# CAFFE_PATH = $(HOME)/caffe +# MXNET_PLUGINS += plugin/caffe/caffe.mk + +# WARPCTC_PATH = $(HOME)/warp-ctc +# MXNET_PLUGINS += plugin/warpctc/warpctc.mk + +# whether to use sframe integration. This requires build sframe +# g...@github.com:dato-code/SFrame.git +# SFRAME_PATH = $(HOME)/SFrame +# MXNET_PLUGINS += plugin/sframe/plugin.mk -- To stop receiving notification emails like this one, please contact marcoab...@apache.org.