fynv / ThrustRTC

CUDA tool set for non-C++ languages that provides similar functionality like Thrust, with NVRTC at its core.
Other
59 stars 6 forks source link

Give more useful debug feedback for internal error #12

Closed edejong-caltech closed 3 years ago

edejong-caltech commented 3 years ago

It would be helpful if the error message an internal error happend reported in check_i in ThrustRTC/Native.py could provide more useful debug feedback.

For instance, is it an error with argument length/type? Is there an illegal operation in the kernel? Is there a typecast error in the kernel?

slayoo commented 3 years ago

One example which can turn very puzzling: if the loop range parameter for launch_n is set to zero (what would intuitively result in no operation being performed), an "Internal error happened" SystemError is raised without any diagnostic message.

fynv commented 3 years ago

Will take a look at this soon.

fynv commented 3 years ago

I've just checked it version 0.3.11. Now the error message should look like: cuLaunchKernel() failed with Error code: 1 Error Name: CUDA_ERROR_INVALID_VALUE Error Description: invalid argument Traceback (most recent call last): File "test_trtc.py", line 30, in kernel.launch(0,0, [darr2, darr_out, trtc.DVInt32(5)]) File "D:\workspace\ThrustRTC_local\install\test_python\ThrustRTC\Context.py", line 56, in launch return check_i(native.n_kernel_launch( File "D:\workspace\ThrustRTC_local\install\test_python\ThrustRTC\Native.py", line 16, in check_i raise SystemError("An internal error happend") SystemError: An internal error happend

slayoo commented 3 years ago

Thank you!

edejong-caltech commented 3 years ago

Looks great, thank you!

slayoo commented 3 years ago

I guess this can be closed than