CUDA-D CEDD: CUDA error: invalid resource handle

1,219 views
Skip to first unread message

Carl Pearson

unread,
Apr 20, 2017, 6:56:03 AM4/20/17
to chai-dev
Hello,

I'm using version 1.0 alpha (539efc98da372d14375da597e4a1de2b21d5f3f2) and in CUDA-D/CEDD, I get the following error while running:

Allocation Time (ms): 0.519392
Initialization Time (ms): 4518.842773
CUDA error: invalid resource handle
 at main.cpp, 246

It only happens sometimes. Other times the run appears to complete, for example:

Allocation Time (ms): 0.438560
Initialization Time (ms): 4522.772949
Total Proxies Time (ms): 1035.043701
CPU Proxy:
CPU Proxy: Kernel Time (ms): 1029.003052
GPU Proxy:
GPU Proxy: Copy To Device Time (ms): 3.672736
GPU Proxy: Kernel Time (ms): 5.394463
GPU Proxy: Copy Back Time (ms): 6.744096
Deallocation Time (ms): 0.434240
Test Passed

My system:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Tue_Jan_10_13:28:28_CST_2017
Cuda compilation tools, release 8.0, V8.0.61

gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Juan Gómez Luna

unread,
Apr 23, 2017, 4:01:14 PM4/23/17
to chai-dev, Carl Pearson
Hi Carl,

I’m trying to reproduce the error, but I can’t.

The error is in the first kernel launch (gaussian).
The description of this error is:
cudaErrorInvalidResourceHandleThis indicates that a resource handle passed to the API call was not valid. Resource handles are opaque types like cudaStream_t and cudaEvent_t.

We aren’t using streams, but we use events for timing purposes. However, the events in, for instance, timer.start("GPU Proxy: Kernel”); are declared within the CPU thread body.
Perhaps cudaError_t (variable type of cudaStatus) is also a resource handle. This one is actually declared in the main thread, not in the proxy thread.

If you find the error again, I suggest you declare cudaStatus within the proxy thread body.
What do you think?

Thanks,
Juan


--
You received this message because you are subscribed to the Google Groups "chai-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chai-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chai-dev/fb7a0552-eaab-4ef5-a2f2-297cf9afe72a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages