From 8a611ead24594a8fa6e0d0a8114bf4fae63c0fe5 Mon Sep 17 00:00:00 2001 From: brandon-b-miller Date: Thu, 3 Nov 2022 07:09:53 -0700 Subject: [PATCH] build and load shim_60.ptx by default --- python/strings_udf/cpp/CMakeLists.txt | 4 ++++ python/strings_udf/strings_udf/__init__.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/strings_udf/cpp/CMakeLists.txt b/python/strings_udf/cpp/CMakeLists.txt index e5b4aca7076..3e58d10d6e2 100644 --- a/python/strings_udf/cpp/CMakeLists.txt +++ b/python/strings_udf/cpp/CMakeLists.txt @@ -92,6 +92,10 @@ endfunction() # Create the shim library for each architecture. set(SHIM_CUDA_FLAGS --expt-relaxed-constexpr -rdc=true) +# always build a default PTX file in case RAPIDS_NO_INITIALIZE is set and the device cc can't be +# safely queried through a context +list(INSERT CMAKE_CUDA_ARCHITECTURES 0 "60") + list(TRANSFORM CMAKE_CUDA_ARCHITECTURES REPLACE "-real" "") list(TRANSFORM CMAKE_CUDA_ARCHITECTURES REPLACE "-virtual" "") list(SORT CMAKE_CUDA_ARCHITECTURES) diff --git a/python/strings_udf/strings_udf/__init__.py b/python/strings_udf/strings_udf/__init__.py index 24f1a2d3bda..2222fb72009 100644 --- a/python/strings_udf/strings_udf/__init__.py +++ b/python/strings_udf/strings_udf/__init__.py @@ -43,7 +43,8 @@ def maybe_patch_numba_linker(driver_version): def _get_ptx_file(): if "RAPIDS_NO_INITIALIZE" in os.environ: - cc = int(os.environ.get("STRINGS_UDF_CC", "52")) + # shim_60.ptx is always built + cc = int(os.environ.get("STRINGS_UDF_CC", "60")) else: dev = cuda.get_current_device()