forked from ROCm/tensorflow-upstream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_rocm
executable file
·26 lines (24 loc) · 1.15 KB
/
build_rocm
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
#!/usr/bin/env bash
#
# prerequisites: install python
# sudo apt-get install python-numpy python-dev python-pip python-wheel
#
# configure with python
# PYTHON_BIN_PATH=/usr/bin/python ./configure
#
# press enter all the way
#
# Explicitly delete the old whl packages in the /tmp/tensorflow_pkg dir
# Doing so comes in handy when the TF version number changes, because
# it will cause the last line in this script (pip3 install ...) to fail.
# Not deleting the old whl packages results in the last line installing
# TF from the previous whl pakcage (if present) and not the current one
# that was just built by this script. Since this error is not apparent, it
# can lead to a lot of frustation and lost time trying to figure why the
# changes made in the current build are not working!
TF_PKG_LOC=/tmp/tensorflow_pkg
rm -f $TF_PKG_LOC/tensorflow*.whl
yes "" | ROCM_PATH=/opt/rocm-3.5.0 TF_NEED_ROCM=1 PYTHON_BIN_PATH=/usr/bin/python ./configure
bazel build --config=opt --config=rocm //tensorflow/tools/pip_package:build_pip_package --verbose_failures &&
bazel-bin/tensorflow/tools/pip_package/build_pip_package $TF_PKG_LOC &&
pip install --upgrade $TF_PKG_LOC/tensorflow*.whl