[llvm-dev] instrumenting device code with gpucc
Jingyue Wu via llvm-dev
llvm-dev at lists.llvm.org
Fri Mar 11 10:10:01 PST 2016
According to the examples you sent, I believe the linking issue was caused
by nvvm reflection anchors. I haven't played with that, but I guess running
nvvm-reflect on an IR removes the nvvm reflect anchors. After that, you can
llvm-link the two bc/ll files.
Another potential issue is that your cuda_hooks-sm_30.ll is unoptimized.
This could cause the instrumented code to run super slow.
On Fri, Mar 11, 2016 at 9:40 AM, Yuanfeng Peng <yuanfeng.jack.peng at gmail.com
> wrote:
> Hey Jingyue,
>
> Attached are the .ll files. Thanks!
>
> yuanfeng
>
> On Fri, Mar 11, 2016 at 3:47 AM, Jingyue Wu <jingyue at google.com> wrote:
>
>> Looks like we are getting closer!
>>
>> On Thu, Mar 10, 2016 at 5:21 PM, Yuanfeng Peng <
>> yuanfeng.jack.peng at gmail.com> wrote:
>>
>>> Hi Jingyue,
>>>
>>> Thank you so much for the helpful response! I didn't know that PTX
>>> assembly cannot be linked; that's likely the reason for my issue.
>>>
>>> So I did the following as you suggested(axpy-sm_30.bc is the
>>> instrumented bitcode, and cuda_hooks-sm_30.bc contains the hook functions):
>>>
>>> *llvm-link axpy-sm_30.bc cuda_hooks-sm_30.bc -o inst_axpy-sm_30.bc*
>>>
>>> *llc inst_axpy-sm_30.bc -o axpy-sm_30.s*
>>>
>>> *"/usr/local/cuda/bin/ptxas" "-m64" "-O3" -c "--gpu-name" "sm_30"
>>> "--output-file" axpy-sm_30.o axpy-sm_30.s*
>>>
>>> However, I got the following error from ptxas:
>>>
>>> *ptxas axpy-sm_30.s, line 106; error : Duplicate definition of
>>> function '_ZL21__nvvm_reflect_anchorv'*
>>>
>>> *ptxas axpy-sm_30.s, line 106; fatal : Parsing error near '.2': syntax
>>> error*
>>>
>>> *ptxas fatal : Ptx assembly aborted due to errors*
>>>
>>> Looks like some cuda function definitions are in both bitcode files
>>> which caused duplicate definition... what am I supposed to do to resolve
>>> this issue?
>>>
>> Can you attach axpy-sm_30.ll and cuda_hooks-sm_30.ll? The duplication may
>> be caused by how nvvm reflection works, but I'd like to see a concrete
>> example.
>>
>>>
>>> Thanks!
>>>
>>> yuanfeng
>>>
>>>
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160311/00cfd504/attachment-0001.html>
More information about the llvm-dev
mailing list