How does OptiX expect geometric primitives to be stored in device memory?

Similar introduction code which builds some simple geometry shapes (plane, box, sphere, torus) can be found inside the OptiX 7 Advanced Examples.
https://forums.developer.nvidia.com/t/optix-advanced-samples-on-github/48410/3

If you look at the createGeometry() function in the github link below, that’s basically textbook code for building a geometry acceleration structure (GAS) for built-in triangle primitives.
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/intro_runtime/src/Application.cpp#L1361

Also explained inside the OptiX Programming Guide chapter about acceleration structures.

It’s called by all of the runtime generated shapes, for example, the box here which consists of only 12 triangles.
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/intro_runtime/src/Box.cpp
Note that the acceleration structure only uses the vertex position of the four vertex attributes (vertex position, tangent, normal, texcoord) defined there.