|
12 | 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 | 13 | # See the License for the specific language governing permissions and
|
14 | 14 | # limitations under the License.
|
15 |
| -# ============================================================================= |
| 15 | +# ============================================================================== |
16 | 16 | PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
|
17 | 17 |
|
18 | 18 | function write_to_bazelrc() {
|
@@ -62,11 +62,11 @@ while [[ "$TF_NEED_CUDA" == "" ]]; do
|
62 | 62 | done
|
63 | 63 |
|
64 | 64 | while [[ "$TF_CUDA_VERSION" == "" ]]; do
|
65 |
| - read -p "Are you building against TensorFlow 2.11(including RCs) or newer?[Y/n] " INPUT |
| 65 | + read -p "Are you building against TensorFlow 2.1(including RCs) or newer?[Y/n] " INPUT |
66 | 66 | case $INPUT in
|
67 |
| - [Yy]* ) echo "Build against TensorFlow 2.11 or newer."; TF_CUDA_VERSION=11;; |
68 |
| - [Nn]* ) echo "Build against TensorFlow <2.11."; TF_CUDA_VERSION=10.0;; |
69 |
| - "" ) echo "Build against TensorFlow 2.11 or newer."; TF_CUDA_VERSION=11;; |
| 67 | + [Yy]* ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=10.1;; |
| 68 | + [Nn]* ) echo "Build against TensorFlow <2.1."; TF_CUDA_VERSION=10.0;; |
| 69 | + "" ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=10.1;; |
70 | 70 | * ) echo "Invalid selection: " $INPUT;;
|
71 | 71 | esac
|
72 | 72 | done
|
|
94 | 94 | TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
|
95 | 95 | TF_LFLAGS="$(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))')"
|
96 | 96 |
|
| 97 | +write_to_bazelrc "build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true" |
| 98 | +if [[ "$PIP_MANYLINUX2010" == "0" ]]; then |
| 99 | + write_to_bazelrc "build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain" |
| 100 | +fi |
97 | 101 |
|
98 | 102 | write_to_bazelrc "build --experimental_repo_remote_exec"
|
99 | 103 | write_to_bazelrc "build --spawn_strategy=standalone"
|
|
138 | 142 |
|
139 | 143 | # TODO(yifeif): do not hardcode path
|
140 | 144 | if [[ "$TF_NEED_CUDA" == "1" ]]; then
|
141 |
| - write_to_bazelrc "build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true" |
142 |
| - write_to_bazelrc "build:cuda --@local_config_cuda//:enable_cuda" |
143 |
| - write_to_bazelrc "build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain" |
144 |
| - |
145 | 145 | write_action_env_to_bazelrc "TF_CUDA_VERSION" ${TF_CUDA_VERSION}
|
146 |
| - write_action_env_to_bazelrc "TF_CUDNN_VERSION" "8" |
| 146 | + write_action_env_to_bazelrc "TF_CUDNN_VERSION" "7" |
147 | 147 | if is_windows; then
|
148 | 148 | write_action_env_to_bazelrc "CUDNN_INSTALL_PATH" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${TF_CUDA_VERSION}"
|
149 | 149 | write_action_env_to_bazelrc "CUDA_TOOLKIT_PATH" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${TF_CUDA_VERSION}"
|
|
0 commit comments