[Resolved] vertex_buffer on linux

I’m using Optix SDK 3.9.1 on CUDA 7.5, Ubuntu 14.04 64bit, GTX 1050 Ti.

I was using Windows and VS 2013 before.Now, I am working on Ubuntu.My problem is that the code running correctly in windows does not work on linux properly. I added GetTickCount function for measuring time.

double GetTickCount(void) 
{
  struct timespec now;
  if (clock_gettime(CLOCK_MONOTONIC, &now))
    return 0;
  return now.tv_sec * 1000.0 + now.tv_nsec / 1000000.0;
}

When,I try to run my code, it gives the error below.

OptiX Error: Type mismatch (Details: Function "RTresult _rtVariableGetObject(RTvariable, void**)" caught exception: Variable is not of OptiX object type, [2622004])

I needed to make comment the buffer vertex_buffer to avoid the error.

//Buffer Vertex = m_context["vertex_buffer"]->getBuffer();
//float3* vert = static_cast<float3*>(Vertex->map());
//Vertex->unmap();

Then, it can run but it is not fine. I need the vertex coordinates to calculate something. How can I get vertex data without this buffer?
Or how can I solve this buffer reading problem?

Kaan

Problem solved when I added the following line to SDK/sutil/OptixMeshImpl.cpp .

m_mesh.m_context[“vertex_buffer”]->setBuffer(m_mesh.m_vbuffer);

geo["vertex_buffer"]->setBuffer( m_mesh.m_vbuffer );
m_mesh.setGeoVindexBuffer( geo, vindex_buffer );
	m_mesh.m_context["vertex_buffer"]->setBuffer(m_mesh.m_vbuffer);

Problem solved when I added the following line to SDK/sutil/OptixMeshImpl.cpp .

m_mesh.m_context[“vertex_buffer”]->setBuffer(m_mesh.m_vbuffer);

geo["vertex_buffer"]->setBuffer( m_mesh.m_vbuffer );
m_mesh.setGeoVindexBuffer( geo, vindex_buffer );
	m_mesh.m_context["vertex_buffer"]->setBuffer(m_mesh.m_vbuffer);

Glad you figured it out. I don’t think this has anything to do with Linux vs. Windows, right? The rather cryptic error about “Variable is not of OptiX object type” means that you tried to get a value (a buffer, in this case) from a variable that doesn’t exist on the context.