Nsight CUDA files unable to index (Member declaration not found)

Hi,

I am using Eclipse Nsight and created a pair of .cu source file and .h file in my project with other .cpp file and header files. However, when I built the program, it shows error - “Member declaration not found” for all the functions declared in .cu file. I have declared the functions in my header and strangely, I am able to open the function declarations from the .cu file.

I suspect that it might be due to some linkers error but I am not sure what exactly went wrong. Any kind souls know the solution?

The problem is the same as this - Cannot get CUDA classes to index

Hi, I have the same issue even with the latest Eclipse 2022-03 + CUDA SDK 11.6.2 on Ubuntu 20.04. Indexer keep spinning one of the CPUs at 100% and stuck on 15%.
Here’s the error log
“Worker-17: C/C++ Indexer” #310 prio=5 os_prio=0 cpu=600948.61ms elapsed=717.53s tid=0x00007f8cb88a71d0 nid=0x158bd runnable [0x00007f8d1d9d4000]

  • java.lang.Thread.State: RUNNABLE*
  • at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.LA(AbstractGNUSourceCodeParser.java:364)*
  • at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.LAcatchEOF(AbstractGNUSourceCodeParser.java:481)*
  • at com.nvidia.cuda.ui.editor.language.CUDACSourceParser.compoundStatement(CUDACSourceParser.java:5441)*
  • at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.functionBody(AbstractGNUSourceCodeParser.java:1531)*
  • at org.eclipse.cdt.internal.core.dom.parser.cpp.GNUCPPSourceParser.functionBody(GNUCPPSourceParser.java:5569)*
  • at com.nvidia.cuda.ui.editor.language.CUDACSourceParser.functionBody(CUDACSourceParser.java:5425)*
  • at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.handleFunctionBody(AbstractGNUSourceCodeParser.java:1520)*
  • at com.nvidia.cuda.ui.editor.language.CUDACSourceParser.functionDefinition(CUDACSourceParser.java:2994)*
  • at com.nvidia.cuda.ui.editor.language.CUDACSourceParser.simpleDeclaration(CUDACSourceParser.java:2902)*
  • at com.nvidia.cuda.ui.editor.language.CUDACSourceParser.declaration(CUDACSourceParser.java:2630)*
  • at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.declarationList(AbstractGNUSourceCodeParser.java:1422)*
  • at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.parseTranslationUnit(AbstractGNUSourceCodeParser.java:1361)*
  • at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.translationUnit(AbstractGNUSourceCodeParser.java:1356)*
  • at org.eclipse.cdt.internal.core.dom.parser.AbstractGNUSourceCodeParser.parse(AbstractGNUSourceCodeParser.java:688)*
  • at com.nvidia.cuda.ui.editor.language.CUDACLanguage.getASTTranslationUnit(CUDACLanguage.java:115)*
  • at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.createAST(AbstractIndexerTask.java:1244)*
  • at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseFile(AbstractIndexerTask.java:1102)*
  • at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseLinkage(AbstractIndexerTask.java:910)*
  • at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.runTask(AbstractIndexerTask.java:572)*
  • at org.eclipse.cdt.internal.core.pdom.indexer.PDOMIndexerTask.run(PDOMIndexerTask.java:164)*
  • at org.eclipse.cdt.internal.core.pdom.indexer.PDOMRebuildTask.run(PDOMRebuildTask.java:94)*
  • at org.eclipse.cdt.internal.core.pdom.PDOMIndexerJob.run(PDOMIndexerJob.java:160)*
  • at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)*