From 05ee2604d8f4e7c6525d12926100e2b11b6d6cb0 Mon Sep 17 00:00:00 2001 From: David Wendt <45795991+davidwendt@users.noreply.github.com> Date: Thu, 21 Sep 2023 10:45:11 -0400 Subject: [PATCH] Fix kernel launch error for cudf::io::orc::gpu::rowgroup_char_counts_kernel (#14139) Fixes memcheck error found during the nightly builds found in gtest `OrcWriterNumericTypeTest/0.SingleColumn` ``` # compute-sanitizer --tool memcheck gtests/ORC_TEST --gtest_filter=OrcWriterNumericTypeTest/0.SingleColumn --rmm_mode=cuda ========= COMPUTE-SANITIZER Note: Google Test filter = OrcWriterNumericTypeTest/0.SingleColumn [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from OrcWriterNumericTypeTest/0, where TypeParam = signed char [ RUN ] OrcWriterNumericTypeTest/0.SingleColumn ========= Program hit cudaErrorInvalidConfiguration (error 9) due to "invalid configuration argument" on CUDA API call to cudaLaunchKernel. ========= Saved host backtrace up to driver entry point at error ========= Host Frame: [0x480aa6] ========= in /usr/lib/x86_64-linux-gnu/libcuda.so.1 ========= Host Frame:cudaLaunchKernel [0x6c358] ========= in /conda/envs/rapids/lib/libcudart.so.11.0 ========= Host Frame:__device_stub__ZN4cudf2io3orc3gpu27rowgroup_char_counts_kernelENS_6detail11base_2dspanIiNS_11device_spanEEENS5_IKNS1_22orc_column_device_viewELm18446744073709551615EEENS4_IKNS1_13rowgroup_rowsES5_EENS5_IKjLm18446744073709551615EEE(cudf::detail::base_2dspan&, cudf::device_span&, cudf::detail::base_2dspan&, cudf::device_span&) [0x14fccb4] ``` Adds a check to avoid the kernel launch if the number of strings column is zero. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Nghia Truong (https://github.com/ttnghia) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cudf/pull/14139 --- cpp/src/io/orc/dict_enc.cu | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/src/io/orc/dict_enc.cu b/cpp/src/io/orc/dict_enc.cu index 0007530a5af..1d2262a1ccc 100644 --- a/cpp/src/io/orc/dict_enc.cu +++ b/cpp/src/io/orc/dict_enc.cu @@ -60,6 +60,7 @@ void rowgroup_char_counts(device_2dspan counts, auto const num_rowgroups = rowgroup_bounds.size().first; auto const num_str_cols = str_col_indexes.size(); + if (num_str_cols == 0) { return; } int block_size = 0; // suggested thread count to use int min_grid_size = 0; // minimum block count required