Assertion failed: "acp->isUsedAsSingleSemanticType()"

I am still in the process of translating the c++ triangles example to c#.

This works pretty well and I am pretty much done. Every object I create I validate() and right now it all comes back ok.

However when I launch I get the following error:

Unknown error (Details: Function “_rtContextLaunch2D” caught exception: Assertion failed: “acp->isUsedAsSingleSemanticType()”, file: , line: 1221)

I searched around, tried disabling parts of the scene to narrow it down, but to no avail.

Any hints on what might cause this?

Edit: Some more info…

As geometry I only use a default Unity cube and get vertices etc. from there.

I tried removing all but one material and different programs for the camera. I also double checked the variables, since the semantic part in the error message seems to point that way, but couldn’t find anything suspicious.

That’s a message from the OptiX internal compiler. This indicates it has trouble translating something in your PTX input code or something is missing.

Please check if your nvcc command line to compile the OptiX *.cu device code to the *.ptx input source is using the same options as in the example you’re porting.

Have a look at this thread which explains how to get those printed by the CMake generated solution:
https://devtalk.nvidia.com/default/topic/1052501/optix/how-would-you-generally-compile-and-run-a-program-which-has-optix-without-make-or-cmake-/

Things to look out for:

  • Do not use -g or -G debug flags.
  • Use --keep-device-functions or --relocatable-device-code=true otherwise callable programs will be eliminated as dead code since CUDA 8.0 because it doesn’t see a call to it. (Note that NVRTC doesn’t support the former option.)
  • Use streaming multiprocessor targets 3.0 or 5.0.
  • Do not use SM 7.5 as PTX target. That won’t be parsed correctly in shipping OptiX versions.
  • Use --use_fast_math to avoid slow trigonometric, square root, reciprocal, or inadvertent double floating point calculations. The resulting PTX source should contain .approx instructions and only floats instead.

Thanks a lot! That should help narrow it down.

I’ll have a stab at it this tomorrow.

Ok, I added the flags you mentioned and made sure not to set -g. Then I looked up the flags that are being passed to NVRTC and added those, which worked except for default-device.

Besides that I don’t set any specific versions, but I only have the most recent SDK installed on this machine anyway.

Since all of that didn’t work I tried copying the precompiled ptx from the SDK, again with the same result. So I am not sure if it’s really the ptx compilation?

I also noted that the only thing that I didn’t validate() were the programs, that is fixed now.

I added the message line from the link to the cmake file, but couldn’t figure out how to trigger it to build the ptx for the triangles sample. When I set CUDA_NVRTC_ENABLED to 0 I just get a “file not found” and I am not sure if debugging this is going to help me.

Currently downloading the most recent drivers (430.86) as I am currently on 425.25.

Could it be that I am on my laptop? The samples work, even if I build them myself, but I am on a 940MX.

What else could be missing that it doesn’t complain about in the Validate()s before?

If you’re seeing that when runnng on a different machine , folder location, or working directories set to not point to the module directory inside the debugger, that might be due to the absolute sample directories baked into the OptiX examples. Check this post:
https://devtalk.nvidia.com/default/topic/1047922/optix/sdk-samples-sutil-getptxstring-file-path-/post/5317954

Trying 430 drivers is a good idea.

Ok, thanks! I keep digging.

For what it’s worth, it used to work when I worked off of the tutorial sample.

Ok, I got the command line string which added a few more options. It builds but I am still getting the same error.

The strange thing is that I keep getting the same issue when I use the precompiled ptx from the SDK.

What is the failing configuration exactly now?
OS version, installed GPU(s), VRAM amount, display driver version, OptiX major.minor.micro version, CUDA toolkit version used to generate the input PTX, host compiler version.

Statements like “most recent” or “latest version” won’t be accurate enough for analysis.

If this failed on 425.25, does it also fail with the 430.86 drivers?

You say that the pre-compiled samples worked, but using the samples’ PTX code in your C# program fails.
Then I would point to the mechanism loading the PTX source code or the method providing it to OptiX.

When using OptiX 6.0.0 the recommended CUDA toolkit for development is 10.0.

I tried some more and it works fine with the tutorials (translated those before trying to do the triangles sample from scratch), up until I start using the geometryTriangles API. I use only the triangles attributes from the optixGeometryTriangles.cu and get the error. (As a test to see when it occurs)

As for the hardware etc.

Windows 10 (17134.765)
940MX (don’t know the vram but currently only sending one cube to it), driver is 430.86, Optix is 6.0.0 and CUDA 10.0.0 (from what I can tell), I comppile using visual Studio 2015, should be v 14.00.24215.1

Also nvcc is version 6.14.11.9000

I doubled checked Optix and it’s really just 6.0.0

I also checked with the dependency walker and that seemed fine, however I am only loading optix.6.0.0.dll (but I add an appropriate path env variable to where this dll is and the others from the bin/x64 directory of the SDK, optix, prime, optixu etc.)

If there is anything else I could provide, please let me know. I would really like to get this one sorted out.

I just found an API for the Optix version and it reports back as “60102” and the version txt inside the CUDA directory is “10.1.168”

I ran into the same problem with my c# wrapper. I tried reducing the ray generation and triangle attributes to bare minimum and my geometry consists of only the tetrahedron in the SDK example but still see this assertion failed error on the launch. All the validate functions pass and no problems in compilation. The wrapper and the ray programs work perfectly if I remove the GeometryTriangles from use.

Did you find the cause of the problem?

Versions etc:
RTX 2080Ti
Windows 10 Enterprise 1709 (16299.1087)
Optix 6.0.0
430.86 drivers

Hey,

this has been an ongoing thing. I made another thread on what I thought was an unrelated issue, but I suspect that those might be related.

I started out with this API https://github.com/HungryBear/OptixCore and added whatever was missing from Optix 6.

This particular one I eventually fixed by adding/removing feature by feature. And it turns out that for some reason Optix didn’t like one of the OptixCore calls (I think it was to add a geometry group). So instead of using the appropriate object wrapper I just used the Api directly and it worked. To this day I haven’t worked out why.

So right now I am thinking about removing the OptixCore part (except for DllImport declarations) and maybe roll my own.

Hi,

I started with the same API. I found only one issue in the OptixCore way of handling the attaching of geometry to geometry instances, the rtGeometryInstanceSetGeometry function call should be replaced with rtGeometryInstanceSetGeometryTriangles in the setter of Geometry in GeometryInstances.cs when triangles are handled but that did not solve the issue. I’ll try the direct API calls also. Thanks for pointers!

Hi,

it’s been a few weeks, but yes I think I remember that one, but beyond that there were other issues.

Good luck!

Hi,

Found the solution, at least for this problem. I inherited the class I made for the triangles from Geometry class which was already in the open source API mentioned and it had a chained constructor which apparently created an empty geometry which I did not notice. I made an empty constructor to the base class and removed the chaining when the triangles are used and now it works. No problem in the OptiX side, it was all C#.

Awesome! Thanks for sharing, I’ll have another look on my end!