"No source available for.." using Nsight Eclipse Edition RC1 on OSX 10.8.1 - eclipse

I'm trying to use CUDA 5 RC1 on OS X Mountain Lion 10.8.1. When debugging from Nsight Eclipse Edition I get the error:
No source available for main()
I've verified that nvcc is set to use -g and -G to emit device and host debug symbols and that -O0 is set to disable optimizations.
Any ideas what the issue is or some other diagnostics I can carry out?

The issue, for me at least, turned out to be that the architecture needed to be set to x64.
To do this, right click on your project and hit Properties.
Then go to Build --> Settings --> Tool Settings.
Under NVCC Compiler --> Code Generation, set Architecture to x64.
Under NVCC Linker --> Miscellaneous set Architecture to x64.
Finally, clean the project and rebuild.

Related

Using clang++ for code analysis in an Autotools project in Eclipse

I am using Eclipse 4.2 on Mac OS 10.8, with the command line tools (Xcode 4.6.3) installed. The clang compiler supports C++11 by means of using the following flags: -std=c++11 -stdlib=libc++.
I have an Autotools-managed project in Eclipse. Real compilation works as expected after overriding CXX and CXXFLAFGS environment variables when configure is called. However, the static code analysis in Eclipse continues to use GCC (the version installed with Xcode is GCC 4.2), so there is no support for C++11, and lots of lines display errors that are not real ones, making static code analysis almost useless.
Using homebrew I also installed GCC 4.7, but I have not succeeded to make Eclipse use that version (or clang++) for performing static code analysis.
Is it possible, when using an Autotools-managed project, to make Eclipse use a different compiler for the static code analysis? Where should I specify that?
After installing Xcode 5, and following the directions in this question, I managed to solve the problem (I cannot test anymore whether this applies to Xcode 4.6 too).
The solution is to go to Project properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers -> CDT GCC Built-in Compiler Settings, and in Command to get compiler specs: append -std=c++11 -stdlib=libc++.
After doing that change, the line should look like:
${COMMAND} -E -P -v -dD ${INPUTS} -std=c++11 -stdlib=libc++

Executing cuda program through Eclipse is giving error

I am using eclipse to execute a cuda program. I have downloaded a CUDA PLUGIN for
eclipse. When I execute sample cuda program given by plugin its fine but when I try
to execute any other program I am getting error undefined reference to main...
make
Building target: Add_cuda
Invoking: NVCC Linker
nvcc -L/export/trainee3/dinesh/cuda5.0/lib64 -o "Add_cuda" ./mycuda.o -lcudart
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
I found in stackoverflow that some times we get this problem because of system startup file
I used flag -nostartfiles but it is not working in my case..
I have included lib64 and include path in c++ build.
So any suggestion to over come this problem....
We've been over this already.
Use nsight eclipse edition instead.
If you have cuda 5.0 or 5.5 installed, just type nsight in a terminal session.
If you really want to use that Eclipse CUDA plugin (which is no longer supported, I don't believe), then start with the C++ sample project, which you agree now and back then would work. Then modify the source code in that project. Don't create your own project.
Install CUDA 5. It comes with Nsight Eclipse version. Very Elegant to use. NV Visual profiler is integrated with Nsight. Syntax highlighting and debug mode are very easy to use.

Eclipse juno + cuda plugin error

I am using Eclipse Juno parallel version. I have installed
cuda plugin. But while building a sample cuda helloworld
program I am getting error -
make all
make: *** No rule to make target `exe_cuda', needed by `all'. Stop.
******Makefile snapshot**************
all: exe_cuda
# Tool invocations
#echo 'No tool found that can build the extension specified with the build
artifact name $#'
# Other Targets
clean:
-$(RM) $(OBJS)$(C_DEPS) exe_cuda
-#echo ' '
Any suggestion......
I agree that the toolchain does not appear to be set up properly for C projects.
My suggestions are:
Create a C++ project instead. That seems to work.
Use Nsight Eclipse Edition instead. It is installed automatically with the linux CUDA 5 package (just type nsight from a terminal window).
You could report the problem to fixstars corporation, the developer of that cuda plugin. It seems they have not updated it since 2011, so I don't know if it's actively maintained. But the help page is here which includes a link for a mailing list you could use.

gdb failing in Eclipse

Here is the tool stack: Installed on Windows 7 (x64) is Eclipse (Juno x64) with CDT and the SConsolidator plugin. Underneath is the TDM-GCC (x64) bundle installed with 64-bit support.
If I build a 64-bit application and debug it using Eclipse (which uses gdb bundled with GCC), it builds without error and debugs fine.
When I build a 32-bit application and try to debug it with Eclipse, it builds fine but gdb fails:
gdb: unknown target exception 0x4000001f...
Debugging it with the same gdb via command line works fine.
Any ideas on how to work around this?
FYI: Here are some warnings leading up to the gdb exception:
warning: `C:\Windows\system32\ntdll.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `C:\Windows\SYSTEM32\wow64.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `C:\Windows\SYSTEM32\wow64win.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `C:\Windows\SYSTEM32\wow64cpu.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: Could not load shared library symbols for ntdll32.dll.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for WOW64_IMAGE_SECTION.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for NOT_AN_IMAGE.
Do you need "set solib-search-path" or "set sysroot"?
warning: Could not load shared library symbols for NOT_AN_IMAGE.
Do you need "set solib-search-path" or "set sysroot"?
I had a similar problem in a different scenario but i think the solution should be applicable here too.
I was gdb.exe downloaded from http://www.equation.com/servlet/equation.cmd?fa=gdb to debug a C++ program.
I first tried the 64-bit because my pc is 64-bit but I got the same error as Paul got above. Then I tried 32-bit gdb.exe and it worked.
I also followed the links that were given by Paul and there was also bundle available for 32-bit. So I assume the bundles depend on the type of application rather than the configuration of the platform. But, I doubt 64-bit bundle will work on 32-bit architecture. I haven't tried that and can't say for sure.
I suggest install the bundles that support 32-bit to debug a 32-bit application.

Nsight Eclipse Edition not finding nvcc

I just installed CUDA 5.0 Preview (Mac OS X Lion) and I'm having trouble with Nsight.
The toolkit seems to be installed correctly. (Driver loads, nvcc -V works in bash, samples work fine).
When I create a new project I get warnings:
Error launching external scanner info generator (nvcc -dryrun ...)
Program 'nvcc' is not found in $PATH
In Preferences -> CUDA Toolkit I get no CUDA-compatible devices detected. Which is strange because I have nVidia GT 650M on my machine. So why doesn't Nsight recognize it?
If I try to build a project I get 2 errors:
/bin/sh: nvcc: command not found
make: * [src/test.o] Error 127
How do you start Nsight? Do you use /usr/local/cuda/bin/nsight? Unfortunately, it is not currently possible to launch Nsight by double-clinking the application on Mac OS X.
In the CUDA 5.0 Preview build we had a bug when shell script did not properly setup paths. This is how this script looks like in latest internal toolkit builds (you may need to adjust paths depending on your toolkit install location - in the final release installer will handle it):
#!/bin/sh
PATH="$PATH:/Developer/NVIDIA/CUDA-5.0/bin" DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Developer/NVIDIA/CUDA-5.0/lib" "/Developer/NVIDIA/CUDA-5.0/libnsight/nsight.app/Contents/MacOS/nsight" $#