mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Removing some default dependencies of CUDA conda builds
Summary: Closes https://github.com/caffe2/caffe2/pull/1847 Reviewed By: orionr Differential Revision: D6900615 Pulled By: pjh5 fbshipit-source-id: 5c9fec941b13bcb1007e0a29801e8e70ec042840
This commit is contained in:
parent
d3ea7e260b
commit
019c1c4ca5
|
|
@ -6,8 +6,6 @@
|
|||
# $ cd <path to caffe2, e.g. ~/caffe2>
|
||||
# $ conda build conda/build
|
||||
#
|
||||
# This installation uses MKL and CUDA
|
||||
#
|
||||
# If you're debugging this, it may be useful to use the env that conda build is
|
||||
# using:
|
||||
# $ cd <anaconda_root>/conda-bld/caffe2_<timestamp>
|
||||
|
|
@ -25,15 +23,9 @@ echo "Installing caffe2 to ${PREFIX}"
|
|||
PYTHON_ARGS="$(python ./scripts/get_python_cmake_flags.py)"
|
||||
CMAKE_ARGS=()
|
||||
|
||||
# Default leveldb from conda-forge doesn't work. If you want to use leveldb,
|
||||
# use this old pip version
|
||||
# pip install leveldb==0.18
|
||||
# Build with minimal required libraries
|
||||
CMAKE_ARGS+=("-DUSE_LEVELDB=OFF")
|
||||
|
||||
# This installation defaults to using MKL because it is much faster. If you
|
||||
# want to build without MKL then you should also remove mkl from meta.yaml in
|
||||
# addition to removing the flags below
|
||||
CMAKE_ARGS+=("-DBLAS=MKL")
|
||||
CMAKE_ARGS+=("-DUSE_MPI=OFF")
|
||||
|
||||
# Build with CUDA
|
||||
CMAKE_ARGS+=("-DUSE_CUDA=ON")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{% set version = "0.8.dev" %}
|
||||
|
||||
package:
|
||||
name: caffe2-cuda
|
||||
name: caffe2-cuda%%CUDA_VERSION%%-cudnn%%CUDNN_VERSION%%
|
||||
version: {{ version }}
|
||||
|
||||
source:
|
||||
|
|
@ -20,8 +20,6 @@ requirements:
|
|||
- glog
|
||||
- gflags
|
||||
- lmdb
|
||||
- mkl-include
|
||||
- mkl
|
||||
- numpy
|
||||
- opencv
|
||||
- python
|
||||
|
|
@ -32,8 +30,6 @@ requirements:
|
|||
- glog
|
||||
- gflags
|
||||
- lmdb
|
||||
- mkl
|
||||
- mkl-include
|
||||
- numpy
|
||||
- opencv
|
||||
- protobuf
|
||||
|
|
|
|||
|
|
@ -21,14 +21,26 @@ if [ -n "$UPLOAD_TO_CONDA" ]; then
|
|||
fi
|
||||
|
||||
# Reinitialize submodules
|
||||
git submodule sync
|
||||
git submodule foreach git fetch
|
||||
git submodule update --init
|
||||
|
||||
# Separate build folder for CUDA builds so that the packages have different
|
||||
# names
|
||||
if [[ "${BUILD_ENVIRONMENT}" == *cuda* ]]; then
|
||||
# CUDA 9.0 and 9.1 are not in conda, and cuDNN is not in conda, so instead of
|
||||
# pinning CUDA and cuDNN versions in the conda_build_config and then setting
|
||||
# the package name in meta.yaml based off of these values, we let Caffe2
|
||||
# take the CUDA and cuDNN versions that it finds in the build environment,
|
||||
# and manually set the package name ourself.
|
||||
# NOTE: These are magic strings that exist in the meta.yaml
|
||||
# WARNING: This does not work on mac.
|
||||
sed -i "s/%%CUDA_VERSION%%/${CAFFE2_CUDA_VERSION}/" "${CAFFE2_ROOT}/conda/cuda/meta.yaml"
|
||||
sed -i "s/%%CUDNN_VERSION%%/${CAFFE2_CUDNN_VERSION}/" "${CAFFE2_ROOT}/conda/cuda/meta.yaml"
|
||||
|
||||
conda build "${CAFFE2_ROOT}/conda/cuda" ${CONDA_BLD_ARGS[@]} "$@"
|
||||
|
||||
# Change the names back
|
||||
sed -i "s/${CAFFE2_CUDA_VERSION}/%%CUDA_VERSION%%/" "${CAFFE2_ROOT}/conda/cuda/meta.yaml"
|
||||
sed -i "s/${CAFFE2_CUDNN_VERSION}/%%CUDNN_VERSION%%/" "${CAFFE2_ROOT}/conda/cuda/meta.yaml"
|
||||
else
|
||||
conda build "${CAFFE2_ROOT}/conda/no_cuda" ${CONDA_BLD_ARGS[@]} "$@"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user