Created
September 25, 2020 10:07
-
-
Save syoyo/2e80c2027278e7cde2107bdb2747d472 to your computer and use it in GitHub Desktop.
OptiX 7.1 illegal memory access issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Issue | |
// * Allocate and provice insufficient data size(e.g. vertex data) fo GAS input. | |
// * Call `optixAccelBuild` with "correct" buffer size(e.g. `buildInput.triangleArray.numVertices`) | |
// * Build GAS against invalid data but no error report at this time | |
// * Some memory object causes 'illegal memory access' error when freeing(also happens in CUDA driver API) | |
// How to reprocible | |
// | |
// OptiX 7.1 optixHair SDK sample | |
// Uncomment following in Util.h | |
//template <typename T> | |
//void copyToDevice( const std::vector<T>& source, CUdeviceptr destination ) | |
//{ | |
// CUDA_CHECK( cudaMemcpy( reinterpret_cast<void*>( destination ), source.data(), source.size() * sizeof( T ), cudaMemcpyHostToDevice ) ); | |
//} | |
// | |
//template <typename T> | |
//void createOnDevice( const std::vector<T>& source, CUdeviceptr* destination ) | |
//{ | |
// CUDA_CHECK( cudaMalloc( reinterpret_cast<void**>( destination ), source.size() * sizeof( T ) ) ); | |
// copyToDevice( source, *destination ); | |
//} | |
// => now createOnDevice, copyToDevice allocates the object of `std::vector` object itself(24 bytes in Linux/gcc) and send only 24 bytes of memory to the device. | |
// Run optixHair will give | |
``` | |
CUDA call (cudaFree( reinterpret_cast<void*>( m_buffer ) ) ) failed with error: 'an illegal memory access was encountered' (/home/syoyo/local/NVIDIA-OptiX-SDK-7.1.0-linux64-x86_64/SDK/optixHair/Head.cpp:197) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment