summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Viallon2020-11-20 11:54:27 +0100
committerAntoine Viallon2020-11-20 11:54:27 +0100
commit6b8adfabfa201f182413759aece3f23f9b5da8c1 (patch)
tree0e1321df6a40f19f075899bebdb5e73acec8b9f4
parent409239779029b5fab891b4d4259d65b4bc5cd1c2 (diff)
downloadaur-6b8adfabfa201f182413759aece3f23f9b5da8c1.tar.gz
Added automatic XLA deactivation when compute capability 3.0 is requested, and filter incompatible compute capabilites automatically
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD25
2 files changed, 24 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index aa97cd75998..b2be24acb1f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = tensorflow-opt-native
pkgdesc = Library for computation using data flow graphs for scalable machine learning (with CFLAGS)
pkgver = 2.3.1
- pkgrel = 5
+ pkgrel = 6
url = https://www.tensorflow.org/
arch = x86_64
license = APACHE
diff --git a/PKGBUILD b/PKGBUILD
index 75ab30693e4..bd39a879fe5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@ pkgbase=tensorflow-opt-native
pkgname=(tensorflow-opt-native tensorflow-opt-native-cuda python-tensorflow-opt-native python-tensorflow-opt-native-cuda)
pkgver=2.3.1
_pkgver=2.3.1
-pkgrel=5
+pkgrel=6
pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CFLAGS)"
url="https://www.tensorflow.org/"
license=('APACHE')
@@ -107,6 +107,27 @@ prepare() {
COMPUTE_CAPABILITIES=5.2,5.3,6.0,6.1,6.2,7.0,7.2,7.5,8.0,8.6
else
echo -e "\e[1mCUDA compute capabilites overriden by env: \e[0m${COMPUTE_CAPABILITIES}"
+ if [[ "${COMPUTE_CAPABILITIES}" =~ "3.0" ]]; then
+ export TF_ENABLE_XLA=0
+ echo -e "\e[1mDisabling XLA because compute capability 3.0 is requested\e[0m"
+ fi
+ CC_ARR=($(echo "$COMPUTE_CAPABILITIES" | tr ',' '\n'))
+ echo "Compute capabilities: ${CC_ARR[@]}"
+ FIXED_CC=""
+ for cc in "${CC_ARR[@]}"; do
+ #echo "Testing $cc..."
+ if [[ $(echo "$cc < 3" | bc -l) == 1 ]]; then
+ echo -e "\e[1mWarning, compute capability $cc is not compatible with tensorflow, REMOVING\e[0m"
+ else
+ if [[ -z "$FIXED_CC" ]]; then
+ FIXED_CC+="$cc"
+ else
+ FIXED_CC+=",$cc"
+ fi
+ fi
+ done
+ echo -e "Fixed compute capabilities: \e[1m$FIXED_CC\e[0m"
+ COMPUTE_CAPABILITIES="$FIXED_CC"
fi
export TF_CUDA_COMPUTE_CAPABILITIES=$COMPUTE_CAPABILITIES
@@ -120,7 +141,7 @@ prepare() {
build() {
echo "Building without cuda and with native optimizations"
cd "${srcdir}"/tensorflow-${_pkgver}-opt-native
- export CC_OPT_FLAGS="$CFLAGS -O3 -funsafe-math-optimizations"
+ export CC_OPT_FLAGS="$CFLAGS -O3 -funsafe-math-optimizations -Wno-deprecated-gpu-targets"
_copts=()
for copt in $CC_OPT_FLAGS; do