CUDA Sample's problem please help,thanks


os:ubuntu 16.04
notebook hardware:GTX965M,Intel 530

runing the oceanFFT and nbody samples ,only-CPU can succesful,GPU show:

CUDA error at oceanFFT.cpp:278 code=5(CUFFT_INTERNAL_ERROR) “cufftPlan2d(&fftPlan, meshSize, meshSize, CUFFT_C2C)”

CUDA error at bodysystemcuda_impl.h:159 code=46(cudaErrorDevicesUnavailable) “cudaEventCreate(&m_deviceData[0].event)”

How can I do?

You need to arrange it so that the OGL context and CUDA context get created on the same GPU. This error arises when the OpenGL context gets created on your Intel 530, and the CUDA context gets createtd on the GTX965M. Your laptop is an Optimus laptop, and it originally shipped with Windows OS. In windows, the solution is to create an optimus profile for the code you want to run, so that the GTX GPU does all the work. You’ll need to research how to do something similar in Linux, since you’ve replaced the OS. The exact method may vary based on your specific notebook design. If you have a BIOS setup option that allows you to use only the GTX GPU, and disable the Intel GPU, that may work.

thanks very much!I’m a beginner,I don’t know the next step,my notebook BIOS don’t have this option

  • some possibilities:
  1. Reinstall the windows environment that your notebook originally shipped with, and do this sort of development on windows. In that case, you just need to create an Optimus profile for the app.

  2. If you want to continue on the linux path, you’ll need to learn about running linux on a optimus notebook. You can find information on the web, but you’ll need to do research and learning. I won’t be able to give you a tutorial here.

  3. Unless CUDA/OpenGL interop is what you exactly need to develop (would be surprising if you are a “beginner”) maybe you should just ignore this issue. It only applies to CUDA/OpenGL interop.

In particular, my comments here pertain to this error: