optix 3.8 errors

Hi, I have some problem with starting the optix demo project.
Like the project “isgReflection”, my demo met an error when running this code

rtWorldSpaceTexture = rtContext->createTextureSamplerFromGLImage(worldSpaceTex, RT_TARGET_GL_TEXTURE_2D);

This error will also occur in the demos like “isgShadows” where opengl and optix cooperate together.
In the other “pure” optix demo like “glass”, another error occurs which shows a warning dialog “: 0xC0000008: An invalid handle was specified。”

I am using CUDA 7.0, WIN 8 , and GTX 980M. And the precompiled deomos all run well.

Thanks.

And I am using vs2012

On a notebook that could be an issue with not using the NVIDIA OpenGL implementation inside the application.
Please read these two threads:
[url]https://devtalk.nvidia.com/default/topic/810104/optix/optix-error-_rtbuffercreatefromglbo-rdquo-caught-exception-hellip-error-cuclgetdevice-/[/url]
[url]https://devtalk.nvidia.com/default/topic/828229/optix/optix-error-of-buffer-size-of-0/[/url]

Thanks for you kindly reply.

But different from the previous two threads, I have disabled the integrated graphics card and have the demos running on the discrete GPU.
The strange thins is that the precompiled demos all run well, no warning message boxes. However, if I build them, most of them will run with some warning message.

And here is the running output of example 3:

OptiX 3.8.0
Number of Devices = 1

Device 0: GeForce GTX 980M
Compute Support: 5 2
Total Memory: 4294967295 bytes
Clock Rate: 1126500 kilohertz
Max. Threads per Block: 1024
SM Count: 12
Execution Timeout Enabled: 1
Max. HW Texture Count: 128
TCC driver enabled: 0
CUDA Device Ordinal: 0

Constructing a context…
Created with 1 device(s)
Supports 2147483647 simultaneous textures
Free memory:
Device 0: 4070866944 bytes

Besides example3 the other examples like example 1 will meet a exception whether in debug or release mode. The exception says:“0xC0000008: An invalid handle was specified”.

I still cannot get optix work.
The cuda device query tells me this:
CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: “GeForce GTX 980M”
CUDA Driver Version / Runtime Version 7.0 / 7.0
CUDA Capability Major/Minor version number: 5.2
Total amount of global memory: 4096 MBytes (4294967296 bytes)
(12) Multiprocessors, (128) CUDA Cores/MP: 1536 CUDA Cores
GPU Max Clock rate: 1127 MHz (1.13 GHz)
Memory Clock rate: 2505 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 2097152 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 2 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
CUDA Device Driver Mode (TCC or WDDM): WDDM (Windows Display Driver Model)
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.0, CUDA Runtime Version = 7.0, NumDevs = 1, Device0 = GeForce GTX 980M
Result = PASS

Is there something wrong with my driver? or this error is related to Mexwell card?

If the pre-compiled demos run well that means your system is generally working fine with OptiX.

It’s unclear how you arrive at the error you describe when building the glass sample. I neither have a laptop nor Windows 8 running that’s why I’ll try to dry debug with some additional debug instructions for you.

I assume you’re running 64-bit pre-compiled executables and also built 64-bit executables yourself by using the top-level CMakeLists.txt inside the OptiX SDK 3.8.0/SDK folder?
If you used 32-bit, please try 64-bit.
Which edition of Visual Studio 2012 are you using? Professional?

The glass sample unconditionally uses OpenGL interop to display the resulting image.
You say your self-built glass example fails with error “0xC0000008: An invalid handle was specified”.
Did you start that from within Visual Studio or outside?
Did you single step through the debug version and can isolate that error to a specific call?

What if you change all examples to not use OpenGL interop by default by changing the SampleScene constructor from m_use_pbo_buffer( true ) to m_use_pbo_buffer( false )?

If latter works, that would still indicate there is something wrong with the OpenGL interop and the things mentioned inside the other posts should work around that.

What OpenGL implementation do you get reported when querying inside a failing example for the glGetString(GL_VENDOR), glGetString(GL_RENDERER) and glGetString(GL_VERSION) after GLUTDisplay::init() in the main() function?
If that is not an NVIDIA based implementation, that would explain the failing OpenGL interop.

Thanks for your kindly reply.
I am using Visual Studio Ultimate 2012 version. I will try other versions of VS later.
I describe the situation as follows:
I use the default CMAKELIST setting and cmake_gui 3.30 to generate optix solution.
I set the compiler to be “Visual Studio 11”in cmake_gui. Then I press “configure” button. After some moment some warning appears as following, like for the glass example

"[i]Generating dependencies for sphere_list.cu
Generating dependencies for adaptive_pinhole_camera.cu
Generating dependencies for glass.cu
Generating dependencies for phong.cu
Generating dependencies for pinhole_camera.cu
Generating dependencies for sunsky.cu
CMake Warning (dev) at CMake/FindCUDA.cmake:930 (elseif):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run “cmake --help-policy CMP0054” for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.

Quoted variables like “WIN32” will no longer be dereferenced when the
policy is set to NEW. Since the policy is not set the OLD behavior will be
used.
Call Stack (most recent call first):
CMakeLists.txt:245 (CUDA_GET_SOURCES_AND_OPTIONS)
whitted/CMakeLists.txt:27 (OPTIX_add_sample_executable)
This warning is for project developers. Use -Wno-dev to suppress it" [/i]

Then I generate the solution the warning output is :

[i] Quoted variables like “WIN32” will no longer be dereferenced when the
policy is set to NEW. Since the policy is not set the OLD behavior will be
used.
Call Stack (most recent call first):
CMakeLists.txt:245 (CUDA_GET_SOURCES_AND_OPTIONS)
glass/CMakeLists.txt:27 (OPTIX_add_sample_executable)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMake/FindCUDA.cmake:930 (elseif):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run “cmake --help-policy CMP0054” for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.[/i]

Then I open the solution, compile it, and run it.
The bug starts within Visual studio.
When I do single step, the error occurs like that: the image can show correctly, but when step into GlassScene::trace() function the 5th time. This error occurs. In other words, in the beginning 4 frames, program runs well, at the 5th frame. It collapses. If I ignore this error, after some loops, it will appear again.

Please continue with all other experiments I mentioned.

The CMake warnings are benign, they shouldn’t happen with an older version like CMake 2.8.12.

I can’t say why things would work four times and then fail and I don’t have the required hard- and software to try.

Are you saying it does not fail if you start the program outside Visual Studio?
Then you could try additionally forcing your Visual Studio 2012 to run on the discrete GPU with a custom profile inside the NV Control Panel.

Could you please list your exact Windows OS version? “8” is not precise enough.

I am sure it will not fail when I start the program “sdk/bin/debug/sphere.exe” directly.
My operation system is “windows 8.1 version 6.3.9600”.
When I changed the constructor instruction of SampleScene, it fails too.

The reason I always fall is due to cg shader version.
I only install cg 32 bit version in default setting, and not install 64 version.
When I alter the link to cg 64 version library, it works well.