Skip to content

Commit

Permalink
tensorflow: make sure tf use the right arch flags
Browse files Browse the repository at this point in the history
  • Loading branch information
david committed Mar 11, 2020
1 parent 9baa7f5 commit 6d5f768
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python-3.7.6-0.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -386,19 +386,21 @@ EOFHIC
export TF_CUDA_VERSION=$(${CUDADIR}/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')
export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' ${CUDADIR}/include/cudnn.h)
export TF_CUDA_COMPUTE_CAPABILITIES=3.5,3.7,5.0,5.2,5.3,6.0,6.1,6.2,7.0,7.2,7.5
export CC_OPT_FLAGS="-march=native"
export CC_OPT_FLAGS="-march=nehalem"
export TF_NEED_CUDA=1

./configure
bazel build \
--cxxopt="-march=nehalem" \
--copt="-march=nehalem" \
//tensorflow:libtensorflow.so \
//tensorflow:libtensorflow_cc.so \
//tensorflow:install_headers \
//tensorflow/tools/pip_package:build_pip_package

mkdir tf-src
./bazel-bin/tensorflow/tools/pip_package/build_pip_package -src ./tf-src
cd tf-src
./bazel-bin/tensorflow/tools/pip_package/build_pip_package -src ${BUILDDIR}/tensorflow-pip
cd ${BUILDDIR}/tensorflow-pip
python3 setup.py build
python3 setup.py install -- prefix $PREFIX

Expand Down

0 comments on commit 6d5f768

Please sign in to comment.