-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Closed
Labels
backend:NVPTXgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
$ clang++ -g -x cuda -c test.cu
ptxas /tmp/test-sm_52-55e123.s, line 841; fatal : Parsing error near '.': syntax error
ptxas fatal : Ptx assembly aborted due to errors
clang++: error: ptxas command failed with exit code 255 (use -v to see invocation)
clang version 20.0.0git (https://github.com/llvm/llvm-project.git 5bd38a98d7585841c1688f6b9eee8ce150dc429c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/test-731cd8.cu
clang++: note: diagnostic msg: /tmp/test-sm_52-df7b05.cu
clang++: note: diagnostic msg: /tmp/test-731cd8.sh
clang++: note: diagnostic msg:
********************
test.cu:
#include <cassert>
__global__ void test(int x) { assert(x > 10); }
int main() {
test<<<1,1>>>(5);
}
Metadata
Metadata
Assignees
Labels
backend:NVPTXgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
jhuber6 commentedon Aug 3, 2024
PTX doesn't accept
.
as a separator in names unlike the rest of the LLVM. We normally replace all of these.
characters with$
when it's emitted. However, in this case the transformation is not applied to the debug symbol, which both causes the error and does not correctly reference the actual assert string.See
llvm/lib/Target/NVPTX/NVPTXAssignValidGlobalNames.cpp
and try to find where we also emit the debug symbols.llvmbot commentedon Aug 3, 2024
Hi!
This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
test/
create fine-grained testing targets, so you can e.g. usemake check-clang-ast
to only run Clang's AST tests.git clang-format HEAD~1
to format your changes.If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.
llvmbot commentedon Aug 3, 2024
@llvm/issue-subscribers-good-first-issue
Author: Ognyan Mirev (OgnianM)
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/test-731cd8.cu
clang++: note: diagnostic msg: /tmp/test-sm_52-df7b05.cu
clang++: note: diagnostic msg: /tmp/test-731cd8.sh
clang++: note: diagnostic msg:
#include <cassert>
global void test(int x) { assert(x > 10); }
int main() {
test<<<1,1>>>(5);
}
vyom1611 commentedon Aug 4, 2024
I can take a look at this, please assign it to me
Artem-B commentedon Aug 14, 2024
This is the same issue as #77009 and #58491
Artem-B commentedon Oct 28, 2024
Should be fixed by #113216