1

I'we been writing some simple cuda program (I'm student so I need to practice), and the thing is I can compile it with nvcc from terminal (using Kubuntu 12.04LTS) and then execute it with optirun ./a.out (hardver is geforce gt 525m on dell inspiron) and everything works fine. The major problem is that I can't do anything from Nsight. When I try to start debug version of code the message is "Launch failed! Binaries not found!". I think it's about running command with optirun but I'm not sure. Any similar experiences? Thanks, for helping in advance folks. :)

Ognjen Kocic
  • 118
  • 2
  • 9
  • In nsight, under Project...Build Configurations...Set Active, is `Debug` or `Release` selected? What build command are you using to build your project? What command are you using to run the debug version? – Robert Crovella Nov 28 '12 at 16:12
  • The debug version is set. :) I'm not sure what do you mean by that. :D I'm running it with a click on green play button and it's running as local c/c++ application and I think now that could be a problem. But I don't know how to set it up properly. Can you help me with this? :) – Ognjen Kocic Nov 28 '12 at 16:23
  • what happens if you do Project...Clean followed by Project...Build Project followed by Run...Debug ? – Robert Crovella Nov 28 '12 at 16:30
  • Thank you very much. I didn't use IDE for C before (only Java) and I was typing Makefile by myself always so I never thought that pushing green start wouldn't do make command. :) It was stupid mistake and I'm sorry for interrupting you. :) Thanks again. – Ognjen Kocic Nov 28 '12 at 16:41
  • For me, pushing the green "run" button *does* do a make (followed by launching the code). You can try it and watch the status window at the bottom. Alternatively, to prove it to yourself, try a Project...Clean followed by pushing the green "run" button. I'm not sure exactly what the issue was in this case. I think pushing the green button *will not* launch debug mode, however. Debug mode (i.e. starting the debugger) and running the debug version of the project are two slightly different things. – Robert Crovella Nov 28 '12 at 16:54

3 Answers3

2

As this was the first post I found when searching for "nsight optirun" I just wanted to wanted to write down the steps I took to make it working for me.

  1. Go to Run -> Debug Configurations -> Debugger

  2. Find the textbox for CUDA GDB executable (in my case it was set to "${cuda_bin}/cuda-gdb")

  3. Prepend "optirun --no-xorg", in my case it was then "optirun --no-xorg ${cuda_bin}/cuda-gdb"

The "--no-xorg" option might not be required or even counterproductive if you have an OpenGL window as it prevents any of that to appear. For my scientific code however it is required as it prevents me from running into kernel timeouts.

Happy bug hunting.

Azrael3000
  • 1,847
  • 12
  • 23
1
  1. We tested Nsight on Optimus systems without optirun - see "Install the cuda toolkit" in CUDA Toolkit Getting Started on using CUDA toolkit on the Optimus system. We have not tried optirun with Nsight EE.
  2. If you still need to use optirun for debugging, you can try making a shell script that uses optirun to start cuda-gdb and set that shell script as cuda-gdb executable in the debug configuration properties.
Eugene
  • 9,242
  • 2
  • 30
  • 29
-2

The simplest thing to do is to run eclipse with optirun, that will also run your app properly.

Eri
  • 1