From 63992b197bdec979830b382300c29a8d395411b1 Mon Sep 17 00:00:00 2001 From: brandon-b-miller Date: Wed, 26 Oct 2022 12:48:15 -0700 Subject: [PATCH] use updated ptxcompiler api --- conda/recipes/strings_udf/meta.yaml | 2 +- python/strings_udf/strings_udf/__init__.py | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/conda/recipes/strings_udf/meta.yaml b/conda/recipes/strings_udf/meta.yaml index e29fb55ce63..9dbd0e56ea1 100644 --- a/conda/recipes/strings_udf/meta.yaml +++ b/conda/recipes/strings_udf/meta.yaml @@ -50,7 +50,7 @@ requirements: - cudf ={{ version }} - {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }} - cachetools - - ptxcompiler # [linux64] # CUDA enhanced compatibility. See https://github.com/rapidsai/ptxcompiler + - ptxcompiler >=0.7.0 # [linux64] # CUDA enhanced compatibility. See https://github.com/rapidsai/ptxcompiler test: # [linux64] requires: # [linux64] - cudatoolkit {{ cuda_version }}.* # [linux64] diff --git a/python/strings_udf/strings_udf/__init__.py b/python/strings_udf/strings_udf/__init__.py index 52434deef64..970d40451d9 100644 --- a/python/strings_udf/strings_udf/__init__.py +++ b/python/strings_udf/strings_udf/__init__.py @@ -8,7 +8,7 @@ from cubinlinker.patch import _numba_version_ok, get_logger, new_patched_linker from numba import cuda from numba.cuda.cudadrv.driver import Linker -from ptxcompiler.patch import CMD +from ptxcompiler.patch import NO_DRIVER, safe_get_versions from . import _version @@ -84,11 +84,8 @@ def get_ptx_file(): return regular_result[1] -# adapted from PTXCompiler -cp = subprocess.run([sys.executable, "-c", CMD], capture_output=True) -# must have a driver to proceed -if cp.returncode == 0: - versions = [int(s) for s in cp.stdout.strip().split()] - driver_version = tuple(versions[:2]) +versions = safe_get_versions() +if not versions == NO_DRIVER: + driver_version, runtime_version = versions maybe_patch_numba_linker(driver_version) ptxpath = get_ptx_file()