summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bershatsky2019-02-21 19:46:47 +0300
committerDaniel Bershatsky2019-02-21 19:46:47 +0300
commit9bca087d504fd5828411586f2fce4cd762d14d83 (patch)
tree656dca6a45440354cb1226a4b3ff582b3a94739d
parenta6aecf7df3f42cc76c21e4d7e0de6d2e4562c26f (diff)
downloadaur-9bca087d504fd5828411586f2fce4cd762d14d83.tar.gz
Apply patch to manage deprecation in CUDA 10
-rw-r--r--.SRCINFO6
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD27
-rw-r--r--cuda10deprecation.patch32
4 files changed, 57 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 42acd3b3a8be..63e6d0a9843c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = python-catboost-gpu-git
pkgdesc = CatBoost is an open-source gradient boosting on decision trees library with categorical features support out of the box.
- pkgver = 0.2
- pkgrel = 2
+ pkgver = r5141.a8f5a19bc
+ pkgrel = 1
epoch = 0
url = https://catboost.yandex
arch = i686
@@ -11,7 +11,9 @@ pkgbase = python-catboost-gpu-git
depends = python-numpy
depends = cuda
source = catboost::git+https://github.com/catboost/catboost.git
+ source = cuda10deprecation.patch
md5sums = SKIP
+ md5sums = 44fc5e88fd55a6d19d45fa61cdca6b70
pkgname = python-catboost-gpu-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..5310140fd8dc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+catboost/
+src/
diff --git a/PKGBUILD b/PKGBUILD
index f2f4b8c7cbce..9fd85dcb238c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Daniel Bershatsky <bepshatsky@yandex.ru>
pkgname=python-catboost-gpu-git
-pkgver=0.2
-pkgrel=2
+pkgver=r5141.a8f5a19bc
+pkgrel=1
epoch=0
pkgdesc="CatBoost is an open-source gradient boosting on decision trees library with categorical features support out of the box."
arch=('i686' 'x86_64')
@@ -17,8 +17,10 @@ replaces=()
backup=()
options=()
-source=("catboost::git+https://github.com/catboost/catboost.git")
-md5sums=('SKIP')
+source=('catboost::git+https://github.com/catboost/catboost.git'
+ 'cuda10deprecation.patch')
+md5sums=('SKIP'
+ '44fc5e88fd55a6d19d45fa61cdca6b70')
validpgpkeys=()
@@ -27,13 +29,22 @@ pkgver() {
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
-package() {
+build() {
export YA_CACHE_DIR=/tmp/.ya
- cd $srcdir/catboost/catboost/python-package/catboost
- ../../../ya make -r -DUSE_ARCADIA_PYTHON=no -DUSE_SYSTEM_PYTHON=3.7 -DPYTHON_CONFIG=python3-config -DCUDA_ROOT=$CUDA_ROOT
+ cd "$srcdir/catboost"
+ git apply "$srcdir/catboost/cuda10deprecation.patch"
- cd ..
+ cd "$srcdir/catboost/catboost/python-package/catboost"
+ ../../../ya make -r \
+ -DUSE_ARCADIA_PYTHON=no \
+ -DPYTHON_CONFIG=python3-config \
+ -DHAVE_CUDA=yes \
+ -DCUDA_ROOT=$CUDA_ROOT
+}
+
+package() {
+ cd "$srcdir/catboost/catboost/python-package"
python3 mk_wheel.py -DCUDA_ROOT=$CUDA_ROOT
pip3 install --prefix $pkgdir/ catboost-*.whl
}
diff --git a/cuda10deprecation.patch b/cuda10deprecation.patch
new file mode 100644
index 000000000000..f09c13659b42
--- /dev/null
+++ b/cuda10deprecation.patch
@@ -0,0 +1,32 @@
+diff --git a/catboost/cuda/cuda_lib/cuda_base.h b/catboost/cuda/cuda_lib/cuda_base.h
+index 9c72b8ef9..b20f76137 100644
+--- a/catboost/cuda/cuda_lib/cuda_base.h
++++ b/catboost/cuda/cuda_lib/cuda_base.h
+@@ -126,7 +126,13 @@ namespace NCudaLib {
+ cudaPointerAttributes attributes;
+ CUDA_SAFE_CALL(cudaPointerGetAttributes(&attributes, (void*)(ptr)));
+ //TODO(noxoomo): currently don't distinguish pinned/non-pinned memory
++#ifndef CUDART_VERSION
++#error "CUDART_VERSION is not defined: include cuda_runtime_api.h"
++#elif (CUDART_VERSION >= 10000)
++ return attributes.type == cudaMemoryTypeHost ? EPtrType::CudaHost : EPtrType::CudaDevice;
++#else
+ return attributes.memoryType == cudaMemoryTypeHost ? EPtrType::CudaHost : EPtrType::CudaDevice;
++#endif
+ }
+
+ template <EPtrType From, EPtrType To>
+@@ -258,7 +264,13 @@ namespace NCudaLib {
+ inline int GetDeviceForPointer(const T* ptr) {
+ cudaPointerAttributes result;
+ CUDA_SAFE_CALL(cudaPointerGetAttributes(&result, (const void*)ptr));
++#ifndef CUDART_VERSION
++#error "CUDART_VERSION is not defined: include cuda_runtime_api.h"
++#elif (CUDART_VERSION >= 10000)
++ CB_ENSURE(result.type == cudaMemoryTypeDevice, "Error: this pointer is not GPU pointer");
++#else
+ CB_ENSURE(result.memoryType == cudaMemoryTypeDevice, "Error: this pointer is not GPU pointer");
++#endif
+ return result.device;
+ }
+