thrust :: sort_by_key上的配置参数无效

时间:2018-05-05 13:12:03

标签: c++ cuda thrust

尝试使用sort_by_key时遇到问题:

我在终端中收到以下错误:

  

在抛出'thrust :: system :: system_error'的实例后终止调用     what():在cub _ :: DeviceRadixSort :: SortPairs(1)之后:无效的配置参数

CUDA代码:(real = float / double)

//Declare and populate device vectors
//---------------------------------------------
thrust::device_vector<real> d_cellXPositions(h_cellXPositions);
real * d_cellXPositions_ptr = thrust::raw_pointer_cast(&d_cellXPositions[0]);

thrust::device_vector<real> d_cellYPositions(h_cellYPositions);
real * d_cellYPositions_ptr = thrust::raw_pointer_cast(&d_cellYPositions[0]);

thrust::device_vector<uint> d_results(_w * _h);
uint * d_results_ptr = thrust::raw_pointer_cast(&d_results[0]);
//---------------------------------------------

//Declare hash and cell occ containers
//---------------------------------------------
thrust::device_vector<uint> d_cellOcc(GRID_RES*GRID_RES, 0);
uint * d_cellOcc_ptr = thrust::raw_pointer_cast(&d_cellOcc[0]);

thrust::device_vector<uint> d_hash(_cellCount, 0);
uint * d_hash_ptr = thrust::raw_pointer_cast(&d_hash[0]);
//---------------------------------------------


//Launch kernels
//---------------------------------------------
uint blockCount = std::ceil(_w*_h)/1024;
uint threadCount = (_w*_h)/blockCount + 1;

printf("Cell count = %d; Hash Size = %d; xPosCount = %d; yPosCount = %d\n",_cellCount, d_hash.size(), d_cellXPositions.size(), d_cellYPositions.size());

std::cout << "Starting kernels \n";

g_pointHash<<<blockCount, threadCount>>>(d_hash_ptr, d_cellXPositions_ptr, d_cellYPositions_ptr, GRID_RES, _w, _h);
cudaThreadSynchronize();
checkCUDAErr();

g_countCellOcc<<<blockCount, threadCount>>>(d_hash_ptr, d_cellOcc_ptr, _w*_h);
cudaThreadSynchronize();
thrust::copy(d_hash.begin(), d_hash.end(), std::ostream_iterator<uint>(std::cout, " "));
std::cout << "~ \n";

//Exclusive scan the cell occ to get the starting indicies

auto tuple = thrust::make_tuple(d_cellXPositions.begin(), d_cellYPositions.begin());
auto zipit = thrust::make_zip_iterator(tuple);
thrust::sort_by_key(d_hash.begin(), d_hash.end(), zipit);
cudaThreadSynchronize();

CUDA-memcheck的输出:

========= CUDA-MEMCHECK
CUDA INFO -------------------
Runtime Version: 7050
Driver Version: 8000
GPU INFO---------------------
Device name: GeForce GTX 1080
Memory Clock Rate (KHz): 5005000
Memory Bus Width (bits): 256
Peak Memory Bandwidth (GB/s): 320.320000
-----------------------------
Left Button Pressed
Cell count = 20; Hash Size = 20; xPosCount = 20; yPosCount = 20
Starting kernels 
========= Program hit cudaErrorInvalidConfiguration (error 9) due to "invalid configuration argument" on CUDA API call to cudaLaunch. 
=========     Saved host backtrace up to driver entry point at error
=========     Host Frame:/usr/lib64/nvidia/libcuda.so.1 [0x2ef343]
=========     Host Frame:/lib64/libcudart.so.7.5 (cudaLaunch + 0x17e) [0x2ed1e]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 [0xace82]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_Z40__device_stub__Z11g_pointHashPjPKdS1_jjjPjPKdS1_jjj + 0x10b) [0xac5b6]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_Z11g_pointHashPjPKdS1_jjj + 0x43) [0xac5fb]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN10CUDASolver14makeDiagram_NNEjjj + 0x48f) [0x83b9b]
=========     Host Frame:application [0x94c2]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN11QMetaObject8activateEP7QObjectiiPPv + 0x659) [0x29bf89]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN15QAbstractButton7clickedEb + 0x32) [0x306c92]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x306e94]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x308a2e]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent + 0xcc) [0x308b7c]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN7QWidget5eventEP6QEvent + 0x1f8) [0x191a48]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 0x9c) [0x1534bc]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN12QApplication6notifyEP7QObjectP6QEvent + 0xc03) [0x15b2c3]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 0x108) [0x271e78]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Eb + 0x1df) [0x159f2f]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x1aaec6]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x1ad81b]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 0x9c) [0x1534bc]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN12QApplication6notifyEP7QObjectP6QEvent + 0x227) [0x15a8e7]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 0x108) [0x271e78]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 0x370) [0x12cf90]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QGuiApplicationPrivate24processWindowSystemEventEPN29QWindowSystemInterfacePrivate17WindowSystemEventE + 0x105) [0x12ed85]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 0xbb) [0x10ad7b]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5 [0xb0fa0]
=========     Host Frame:/lib64/libglib-2.0.so.0 (g_main_context_dispatch + 0x15a) [0x49d7a]
=========     Host Frame:/lib64/libglib-2.0.so.0 [0x4a0b8]
=========     Host Frame:/lib64/libglib-2.0.so.0 (g_main_context_iteration + 0x2c) [0x4a16c]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 0x5f) [0x2c393f]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 0xea) [0x2705ea]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication4execEv + 0x84) [0x278a44]
=========     Host Frame:application [0x734d]
=========     Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x21b35]
=========     Host Frame:application [0x75a7]
=========
========= Program hit cudaErrorInvalidConfiguration (error 9) due to "invalid configuration argument" on CUDA API call to cudaGetLastError. 
=========     Saved host backtrace up to driver entry point at error
=========     Host Frame:/usr/lib64/nvidia/libcuda.so.1 [0x2ef343]
=========     Host Frame:/lib64/libcudart.so.7.5 (cudaGetLastError + 0x163) [0x30713]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN10CUDASolver12checkCUDAErrEv + 0x11) [0x83591]
Error: invalid configuration argument
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN10CUDASolver14makeDiagram_NNEjjj + 0x49e) [0x83baa]
=========     Host Frame:application [0x94c2]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN11QMetaObject8activateEP7QObjectiiPPv + 0x659) [0x29bf89]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN15QAbstractButton7clickedEb + 0x32) [0x306c92]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x306e94]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x308a2e]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent + 0xcc) [0x308b7c]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN7QWidget5eventEP6QEvent + 0x1f8) [0x191a48]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 0x9c) [0x1534bc]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN12QApplication6notifyEP7QObjectP6QEvent + 0xc03) [0x15b2c3]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 0x108) [0x271e78]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Eb + 0x1df) [0x159f2f]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x1aaec6]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x1ad81b]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 0x9c) [0x1534bc]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN12QApplication6notifyEP7QObjectP6QEvent + 0x227) [0x15a8e7]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 0x108) [0x271e78]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 0x370) [0x12cf90]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QGuiApplicationPrivate24processWindowSystemEventEPN29QWindowSystemInterfacePrivate17WindowSystemEventE + 0x105) [0x12ed85]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 0xbb) [0x10ad7b]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5 [0xb0fa0]
=========     Host Frame:/lib64/libglib-2.0.so.0 (g_main_context_dispatch + 0x15a) [0x49d7a]
=========     Host Frame:/lib64/libglib-2.0.so.0 [0x4a0b8]
=========     Host Frame:/lib64/libglib-2.0.so.0 (g_main_context_iteration + 0x2c) [0x4a16c]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 0x5f) [0x2c393f]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 0xea) [0x2705ea]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication4execEv + 0x84) [0x278a44]
=========     Host Frame:application [0x734d]
=========     Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x21b35]
=========     Host Frame:application [0x75a7]
=========
========= Program hit cudaErrorInvalidConfiguration (error 9) due to "invalid configuration argument" on CUDA API call to cudaLaunch. 
=========     Saved host backtrace up to driver entry point at error
=========     Host Frame:/usr/lib64/nvidia/libcuda.so.1 [0x2ef343]
=========     Host Frame:/lib64/libcudart.so.7.5 (cudaLaunch + 0x17e) [0x2ed1e]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 [0xace82]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_Z37__device_stub__Z14g_countCellOccPjS_jPjS_j + 0x93) [0xac690]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_Z14g_countCellOccPjS_j + 0x29) [0xac6bb]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN10CUDASolver14makeDiagram_NNEjjj + 0x531) [0x83c3d]
=========     Host Frame:application [0x94c2]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN11QMetaObject8activateEP7QObjectiiPPv + 0x659) [0x29bf89]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN15QAbstractButton7clickedEb + 0x32) [0x306c92]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x306e94]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x308a2e]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent + 0xcc) [0x308b7c]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN7QWidget5eventEP6QEvent + 0x1f8) [0x191a48]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 0x9c) [0x1534bc]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN12QApplication6notifyEP7QObjectP6QEvent + 0xc03) [0x15b2c3]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 0x108) [0x271e78]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Eb + 0x1df) [0x159f2f]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x1aaec6]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x1ad81b]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 0x9c) [0x1534bc]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN12QApplication6notifyEP7QObjectP6QEvent + 0x227) [0x15a8e7]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 0x108) [0x271e78]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 0x370) [0x12cf90]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QGuiApplicationPrivate24processWindowSystemEventEPN29QWindowSystemInterfacePrivate17WindowSystemEventE + 0x105) [0x12ed85]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 0xbb) [0x10ad7b]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5 [0xb0fa0]
=========     Host Frame:/lib64/libglib-2.0.so.0 (g_main_context_dispatch + 0x15a) [0x49d7a]
=========     Host Frame:/lib64/libglib-2.0.so.0 [0x4a0b8]
=========     Host Frame:/lib64/libglib-2.0.so.0 (g_main_context_iteration + 0x2c) [0x4a16c]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 0x5f) [0x2c393f]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 0xea) [0x2705ea]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication4execEv + 0x84) [0x278a44]
=========     Host Frame:application [0x734d]
=========     Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x21b35]
=========     Host Frame:application [0x75a7]
=========
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ~ 
========= Program hit cudaErrorInvalidConfiguration (error 9) due to "invalid configuration argument" on CUDA API call to cudaPeekAtLastError. 
=========     Saved host backtrace up to driver entry point at error
=========     Host Frame:/usr/lib64/nvidia/libcuda.so.1 [0x2ef343]
=========     Host Frame:/lib64/libcudart.so.7.5 (cudaPeekAtLastError + 0x163) [0x305a3]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system4cuda6detail4cub_15DeviceRadixSort9SortPairsIjNS_5tupleIddNS_9null_typeES7_S7_S7_S7_S7_S7_S7_EEEE9cudaErrorPvRmRNS3_12DoubleBufferIT_EERNSC_IT0_EEiiiP11CUstream_stb + 0x8312) [0x9d4e5]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZZN6thrust6system4cuda6detail6detail24stable_radix_sort_detail22cub_sort_pairs_wrapperIjNS_5tupleIddNS_9null_typeES7_S7_S7_S7_S7_S7_S7_EEEE9cudaErrorPvRmRNS2_4cub_12DoubleBufferIT_EERNSD_IT0_EEiNS_4lessISE_EEiiP11CUstream_stbEN10workaround9host_pathESA_SB_RNSD_IjEERNSD_IS8_EEiNSK_IjEEiiSN_b + 0x5d) [0x940f5]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system4cuda6detail6detail24stable_radix_sort_detail22cub_sort_pairs_wrapperIjNS_5tupleIddNS_9null_typeES7_S7_S7_S7_S7_S7_S7_EEEE9cudaErrorPvRmRNS2_4cub_12DoubleBufferIT_EERNSD_IT0_EEiNS_4lessISE_EEiiP11CUstream_stb + 0x62) [0x94159]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system4cuda6detail6detail24stable_radix_sort_detail26stable_radix_sort_by_key_nINS2_3tagEjNS_5tupleIddNS_9null_typeES8_S8_S8_S8_S8_S8_S8_EENS_4lessIjEEEEvRNS2_16execution_policyIT_EEPT0_mPT1_T2_ + 0x297) [0x933f6]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system4cuda6detail6detail24stable_radix_sort_by_keyINS2_3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS7_INS_7pointerINS_5tupleIddNS_9null_typeESD_SD_SD_SD_SD_SD_SD_EES5_NS_11use_defaultESF_EEEEEEvRNS2_16execution_policyIT_EET0_SM_T1_NS_4lessINS_14iterator_valueISM_E4typeEEE + 0xb0) [0x92743]
terminate called after throwing an instance of '=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system4cuda6detail6detail28stable_primitive_sort_detail28stable_primitive_sort_by_keyINS2_3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS8_INS_7pointerINS_5tupleIddNS_9null_typeESE_SE_SE_SE_SE_SE_SE_EES6_NS_11use_defaultESG_EEEENS_4lessIjEEEENS4_20disable_if_bool_sortIT0_E4typeERNS2_16execution_policyIT_EESM_SM_T1_T2_ + 0x34) [0x91d3d]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system4cuda6detail6detail28stable_primitive_sort_by_keyINS2_3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS7_INS_7pointerINS_5tupleIddNS_9null_typeESD_SD_SD_SD_SD_SD_SD_EES5_NS_11use_defaultESF_EEEEEEvRNS2_16execution_policyIT_EET0_SM_T1_NS_4lessINS_14iterator_valueISM_E4typeEEE + 0x34) [0x91260]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system4cuda6detail18stable_sort_detail18stable_sort_by_keyINS2_3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS7_INS8_IdEEEESE_NS_9null_typeESF_SF_SF_SF_SF_SF_SF_EEEENS_4lessIjEEEENS3_24enable_if_primitive_sortIT0_T2_E4typeERNS2_16execution_policyIT_EESL_SL_T1_SM_ + 0xcb) [0x90885]
thrust::system::system_error=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZZN6thrust6system4cuda6detail18stable_sort_by_keyINS2_3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS6_INS7_IdEEEESD_NS_9null_typeESE_SE_SE_SE_SE_SE_SE_EEEENS_4lessIjEEEEvRNS2_16execution_policyIT_EET0_SN_T1_T2_EN10workaround13parallel_pathERNSJ_IS4_EES9_S9_SG_SI_ + 0x48) [0x8fe38]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system4cuda6detail18stable_sort_by_keyINS2_3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS6_INS7_IdEEEESD_NS_9null_typeESE_SE_SE_SE_SE_SE_SE_EEEENS_4lessIjEEEEvRNS2_16execution_policyIT_EET0_SN_T1_T2_ + 0x48) [0x8fe82]
'
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust18stable_sort_by_keyINS_6system4cuda6detail3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS6_INS7_IdEEEESD_NS_9null_typeESE_SE_SE_SE_SE_SE_SE_EEEENS_4lessIjEEEEvRKNS5_21execution_policy_baseIT_EET0_SO_T1_T2_ + 0x58) [0x8f28b]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system6detail7generic11sort_by_keyINS0_4cuda6detail3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS8_INS9_IdEEEESF_NS_9null_typeESG_SG_SG_SG_SG_SG_SG_EEEENS_4lessIjEEEEvRNS_16execution_policyIT_EET0_SP_T1_T2_ + 0x48) [0x8e3ab]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust11sort_by_keyINS_6system4cuda6detail3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS6_INS7_IdEEEESD_NS_9null_typeESE_SE_SE_SE_SE_SE_SE_EEEENS_4lessIjEEEEvRKNS5_21execution_policy_baseIT_EET0_SO_T1_T2_ + 0x58) [0x8d590]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust6system6detail7generic11sort_by_keyINS0_4cuda6detail3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS8_INS9_IdEEEESF_NS_9null_typeESG_SG_SG_SG_SG_SG_SG_EEEEEEvRNS_16execution_policyIT_EET0_SN_T1_ + 0x48) [0x8c79a]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust11sort_by_keyINS_6system4cuda6detail3tagENS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS6_INS7_IdEEEESD_NS_9null_typeESE_SE_SE_SE_SE_SE_SE_EEEEEEvRKNS5_21execution_policy_baseIT_EET0_SM_T1_ + 0x54) [0x8b669]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN6thrust11sort_by_keyINS_6detail15normal_iteratorINS_10device_ptrIjEEEENS_12zip_iteratorINS_5tupleINS2_INS3_IdEEEES9_NS_9null_typeESA_SA_SA_SA_SA_SA_SA_EEEEEEvT_SD_T0_ + 0x46) [0x8a139]
=========     Host Frame:/home/i7469704/parallelvoronoi/Common/../lib/libsolver_gpu.so.1 (_ZN10CUDASolver14makeDiagram_NNEjjj + 0x661) [0x83d6d]
=========     Host Frame:application [0x94c2]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN11QMetaObject8activateEP7QObjectiiPPv + 0x659) [0x29bf89]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN15QAbstractButton7clickedEb + 0x32) [0x306c92]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x306e94]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x308a2e]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent + 0xcc) [0x308b7c]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN7QWidget5eventEP6QEvent + 0x1f8) [0x191a48]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 0x9c) [0x1534bc]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN12QApplication6notifyEP7QObjectP6QEvent + 0xc03) [0x15b2c3]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 0x108) [0x271e78]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Eb + 0x1df) [0x159f2f]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x1aaec6]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 [0x1ad81b]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 0x9c) [0x1534bc]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Widgets.so.5 (_ZN12QApplication6notifyEP7QObjectP6QEvent + 0x227) [0x15a8e7]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 0x108) [0x271e78]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QGuiApplicationPrivate17processMouseEventEPN29QWindowSystemInterfacePrivate10MouseEventE + 0x370) [0x12cf90]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QGuiApplicationPrivate24processWindowSystemEventEPN29QWindowSystemInterfacePrivate17WindowSystemEventE + 0x105) [0x12ed85]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Gui.so.5 (_ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 0xbb) [0x10ad7b]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5 [0xb0fa0]
=========     Host Frame:/lib64/libglib-2.0.so.0 (g_main_context_dispatch + 0x15a) [0x49d7a]
=========     Host Frame:/lib64/libglib-2.0.so.0 [0x4a0b8]
=========     Host Frame:/lib64/libglib-2.0.so.0 (g_main_context_iteration + 0x2c) [0x4a16c]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 0x5f) [0x2c393f]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 0xea) [0x2705ea]
=========     Host Frame:/opt/Qt5.9.0/5.9/gcc_64/lib/libQt5Core.so.5 (_ZN16QCoreApplication4execEv + 0x84) [0x278a44]
=========     Host Frame:application [0x734d]
=========     Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x21b35]
=========     Host Frame:application [0x75a7]
=========
  what():  after cub_::DeviceRadixSort::SortPairs(1): invalid configuration argument
========= Error: process didn't terminate successfully
========= Internal error (20)
========= No CUDA-MEMCHECK results found

信息超载,但如果您还需要,请告诉我。

1 个答案:

答案 0 :(得分:1)

  1. 这样的问题应该包括项目1 here中所示的MCVE。

  2. 我怀疑无论使用什么CUDA错误检查都有很大的价值,因为这里的错误(由评论中的OP确认)与CUDA代码有关,而不是Thrust。无论这条线在做什么:

    checkCUDAErr();
    

    似乎不足以防止此处产生的混淆。

  3. 这里的主要问题(如评论中的OP所示)似乎是这个网格/线程大小计算存在缺陷:

    uint blockCount = std::ceil(_w*_h)/1024;
    uint threadCount = (_w*_h)/blockCount + 1;
    

    我认为_w*_h的任何乘积为1024的整数乘以会产生threadCount的不正确大小。一个具体的例子是_w*_h是1024.然后blockCount将是1.当blockCount为1时,threadCount变量将以1025结束,这是非法的CUDA的块大小。这里可能的解决方案可能是简单地将threadCount设置为1024,硬编码。这显然是在blockCount计算中使用的块大小,虽然未显示内核代码,但它似乎在其中有正确的线程检查,因为当前blockCount和{ {1}}计算涉及&#34;四舍五入&#34;。

  4. 推力通常具有良好的错误检查功能,当您调用推力算法时,可能会显示与推力无关的先前代码错误,因为它会指示任何先前的错误(尚未清除) 。但是这里的错误(上面的3)与Thrust无关。

  5. 我会鼓励使用Pascal GPU的人升级到至少CUDA 8(这里似乎使用了CUDA 7.5)。我鼓励使用Volta GPU的人升级到至少CUDA 9。