CUDA 7.5/ win10 simpleCUDA2GL SDK sample failure [SOLVED]

Hi,

→ I’ve done a fresh install on a new win 10 machine.
→ There are exceptions being thrown on certain CUDA & OpenGL interop calls

On the “simpleCUDA2GL” SDK sample im getting:

At:

...
 checkCudaErrors(cudaGraphicsMapResources(1, &cuda_tex_result_resource, 0)); // line 264
...

The cuda_tex_result_resource pointer does get updated after call to:

cudaGraphicsGLRegisterImage(&cuda_tex_result_resource, *tex_cudaResult,  GL_TEXTURE_2D, cudaGraphicsMapFlagsWriteDiscard);

deviceQuery on my machine:

Any hints?

Thanks for your time!

Is the behavior any different if you specify an optimus profile setting for that app ( “simpleCUDA2GL” ) specifying use of the NVIDIA GPU:

[url]How do I customize Optimus profiles and settings? | NVIDIA

no, the behaviour is still the same… I had been been suspecting an issue with optimus so this seemed like the correct “gotcha” but to no avail. :-)

nbody - runs just fine, bit im guessing it uses a different interop method. Which makes this issue look quite odd.

I just ran into what seems like the same interop bug.

I’m using GLFW / CUDA 7.5 / 358.x in a Debug build.

The first CUDA Runtime device function after the initial cudaSetDevice() crashes in the CUDA runtime.

The non-Debug build appears to work fine.

Reverting from 358.x to 355.x solved the problem.

int
main(int argc, char* argv[])
{
  //
  // INIT GLFW
  //
  ...

  //
  // INIT CUDA DEVICE
  //
  // enable pinned/write-combined allocations
  cuda(SetDeviceFlags(cudaDeviceMapHost | cudaDeviceScheduleBlockingSync));
  cuda(SetDevice(cuda_device_id));

  // force initialization
  cuda(Free(0));  // <--- Debug build crashes hard here deep in the CUDA RT on a NULL pointer.
                  //      It fails on the first call after cudaSetDevice() whether it's this 
                  //      initialization idiom or something innocuous like cudaDeviceGetLimit().

I tried both Quadro and GeForce drivers in 358.x and 355.x.

355.x works for me.

System: Win7/x64 | Quadro K620 | GTX 750 Ti | GTX 980 | CUDA 7.5

Update: the problem might be in the PTX compilation phase.

For Debug builds I am witnessing the following behavior:

358.91:  -gencode=arch=compute_52,code=compute_52   CRASH in CUDA runtime function
358.91:  -gencode=arch=compute_52,code=sm_52        OK

354.42:  -gencode=arch=compute_52,code=compute_52   OK
354.42:  -gencode=arch=compute_52,code=sm_52        OK

Oh well… 358.x has an issue.

Thanks Allan! Will give it a go on my machine this evening!

http://www.nvidia.com/download/driverResults.aspx/95553/en-us

http://www.nvidia.com/download/driverResults.aspx/95559/en-us

Can you all please test 359.00 WHQL driver?

Just tested 359.00 – my Debug GLFW interop app still crashes in the first CUDA function after cudaSetDevice():

359.00:  -gencode=arch=compute_52,code=compute_52   CRASH in CUDA runtime function
359.00:  -gencode=arch=compute_52,code=sm_52        OK

358.91:  -gencode=arch=compute_52,code=compute_52   CRASH in CUDA runtime function
358.91:  -gencode=arch=compute_52,code=sm_52        OK

354.42:  -gencode=arch=compute_52,code=compute_52   OK
354.42:  -gencode=arch=compute_52,code=sm_52        OK

PASS on simpleCUDA2GL sample for driver 361.43

Thank you Nvidia :)