在构建cuda代码-g -G
之前,我有一个运行良好的复杂Cuda C ++应用程序。进行构建调试时,它与cudaErrorIllegalAddress
一起崩溃,因此我运行了cuda-memcheck
,但这没有发现任何问题。我还运行了valgrind
,但没有发现问题。
当cuda-memcheck
找不到任何内容时,有哪些策略可以找出在Cuda代码中发生的非法内存读取或写入的位置? cuda-gdb
是否可以通过无效的内存访问代码行?
答案 0 :(得分:0)
我在cuda-gdb
下运行我的应用程序,调试器在无效的内存访问中得到了一个断点:
CUDA Exception: Warp Illegal Address
The exception was triggered at PC 0x50225260 (gpu_core.h:275)
Thread 1 "preprocess" received signal CUDA_EXCEPTION_14, Warp Illegal Address.
[Switching focus to CUDA kernel 0, grid 617, block (0,0,0), thread (0,0,0), device 0, sm 0, warp 2, lane 0]
0x0000000050225270 in thrust::cuda_cub::cub::BlockRadixSort<int, 256, 19, int, 6, true, (thrust::cuda_cub::cub::BlockScanAlgorithm)2, (cudaSharedMemConfig)1, 1, 1, 700>::BlockRadixSort (this=0x0, this=0x0, temp_storage=0xffffb17cffff159c, keys=0x1300001d1300001d, values=0x1300001d1300001d, begin_bit=<optimized out>, end_bit=<optimized out>, is_descending=..., is_keys_only=..., num_items=<optimized out>) at /home/user/git/infra/libgpu/src/gpu_core.h:275