# rtAccelerationGetData in Optix 4.0

**URL:** <https://forums.developer.nvidia.com/t/rtaccelerationgetdata-in-optix-4-0/47849>\
**Category:** OptiX\
**Created:** [February 13, 2017, 10:41pm UTC](https://forums.developer.nvidia.com/t/rtaccelerationgetdata-in-optix-4-0/47849 "2017-02-13T22:41:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbanquiero](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mbanquiero](https://forums.developer.nvidia.com/u/mbanquiero)\
**Post date:** [February 13, 2017, 10:41pm UTC](https://forums.developer.nvidia.com/t/rtaccelerationgetdata-in-optix-4-0/47849/1 "2017-02-13T22:41:50Z")

</div>

Hi.

I am beginner using Optix. I want to avoid building de BHV every time I load the model, by cache acceleration structure alonside the model, as suggested in this presentation (page 19)

> **[S3475-Ray-Tracking-With-OptiX.pdf](https://on-demand.gputechconf.com/gtc/2013/presentations/S3475-Ray-Tracking-With-OptiX.pdf)**
>
> 2.72 MB

Them,  
The idea is to use rtAccelerationGetData the first time the tree is build, and rtAccelerationSetData the following times, since the scene geometry is fixed (there is no animation or moving object).

The problem is rtAccelerationGetData always return 320 bytes header and it´s seems there is no tree information. Checking the manual I found rtAccelerationGetData was deprecated in optix 4.0.

Which function or alternative scheme should I use?

Thanks,

---

<div class="post-metadata">

**Author:** ![dlacewell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dlacewell](https://forums.developer.nvidia.com/u/dlacewell)\
**Post date:** [February 14, 2017, 5:51pm UTC](https://forums.developer.nvidia.com/t/rtaccelerationgetdata-in-optix-4-0/47849/2 "2017-02-14T17:51:30Z")

</div>

The rtAccelerationGetData/SetData functions are from a time when building a BVH took many seconds. That is no longer the case. Now you should just use the default “Trbvh” builder type, which builds in parallel on the device.

---

<div class="post-metadata">

**Author:** ![mbanquiero](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mbanquiero](https://forums.developer.nvidia.com/u/mbanquiero)\
**Post date:** [February 14, 2017, 11:00pm UTC](https://forums.developer.nvidia.com/t/rtaccelerationgetdata-in-optix-4-0/47849/3 "2017-02-14T23:00:31Z")

</div>

Thanks for your quick response.

I´m loading a scene made of 500.000 triangles, and it takes about 20 / 30 seconds to start. But, as you said, I could verify that the TRBVH builder is extremelly fast, so the bottle neck must be in other place.( I´m loading several textures and compute LOD mipmaping also).  
Thanks again!

---

<div class="post-metadata">

**Author:** ![dlacewell](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dlacewell](https://forums.developer.nvidia.com/u/dlacewell)\
**Post date:** [February 14, 2017, 11:50pm UTC](https://forums.developer.nvidia.com/t/rtaccelerationgetdata-in-optix-4-0/47849/4 "2017-02-14T23:50:38Z")

</div>

Yes, the Trbvh builder should handle 500k triangles in \< 1 second for most hardware.

You might try timing the first OptiX launch (you can use sutil::currentTime() if nothing else). The first launch includes a JIT compile step, a BVH build step, and the frame render. That should at least rule out an OptiX overhead vs. other things like building mip levels.

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [June 14, 2022, 9:11pm UTC](https://forums.developer.nvidia.com/t/rtaccelerationgetdata-in-optix-4-0/47849/5 "2022-06-14T21:11:14Z")

</div>

Closed on June 14, 2022, 9:11pm UTC


