Last active
February 9, 2021 12:13
-
-
Save mikaelhg/86f8c183e0da666709c1ddaec1baac8c to your computer and use it in GitHub Desktop.
Tensorflow Java build scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AWS P2 instance type has K80 GPUs, compute capability 3.7 | |
# AWS P3 instance type has V100 GPUs, compute capability 7.0 | |
build:cuda --action_env=TF_CUDA_COMPUTE_CAPABILITIES=3.7,7.0 | |
build:cuda --action_env=TF_CUDA_VERSION=10 | |
build:cuda --action_env=TF_CUDNN_VERSION=7 | |
# manually installed CUDA and cuDNN | |
build:cuda --action_env=TF_CUDA_PATHS=/usr/local/cuda-10.2.89,/usr/local/cudnn-10.2-7.6.5.32 | |
build:cuda --action_env=CUDA_TOOLKIT_PATH=/usr/local/cuda-10.2.89 | |
build:cuda --action_env=CUDNN_INSTALL_PATH=/usr/local/cudnn-10.2-7.6.5.32 | |
# Docker image | |
#build:cuda --action_env=TF_CUDA_PATHS=/usr/local/cuda,/usr/lib/x86_64-linux-gnu,/usr | |
#build:cuda --action_env=CUDA_TOOLKIT_PATH=/usr/local/cuda | |
#build:cuda --action_env=CUDNN_INSTALL_PATH=/usr/lib/x86_64-linux-gnu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cp .bazelrc.user ./tfjava/tensorflow-core/tensorflow-core-api/.bazelrc.user | |
GCC_HOST_COMPILER_PATH=/usr/bin/gcc-8 \ | |
CC=/usr/bin/gcc-8 \ | |
CXX=/usr/bin/g++-8 \ | |
TMP=/tmp \ | |
USE_BAZEL_VERSION=3.1.0 \ | |
mvn install -Dmaven.test.skip=true -Djavacpp.platform.extension=-gpu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
strings ./tensorflow-core/tensorflow-core-api/target/native/org/tensorflow/internal/c_api/linux-x86_64-gpu/libtensorflow_cc.so.2 | grep 'target sm_' | sort | uniq | |
# Output: | |
#.target sm_30 | |
#.target sm_35 | |
#.target sm_37 | |
#.target sm_50 | |
#.target sm_61 | |
#.target sm_70 | |
#.target sm_75 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment