I’m migrating a project from optix6.5 to optix8,use the same camkeLists.txt as in the optix app for the key sections
set(OPTIX_INCLUDE_DIR "${OPTIX80_INCLUDE_DIR}")
set(USE_OPTIX_IR TRUE)
set(OPTIX_MODULE_EXTENSION ".optixir")
set(OPTIX_PROGRAM_TARGET "--optix-ir")
include_directories(
${OPTIX_INCLUDE_DIR}
${CUDAToolkit_INCLUDE_DIRS}
)
# When using OptiX SDK 7.5.0 and CUDA 11.7 or higher, the modules can either be built from OptiX IR input or from PTX input.
# OPTIX_PROGRAM_TARGET and OPTIX_MODULE_EXTENSION switch the NVCC compilation between the two options.
NVCUDA_COMPILE_MODULE(
SOURCES ${CudaSrc}
DEPENDENCIES ${CudaHeader}
TARGET_PATH "${MODULE_TARGET_DIR}/OptixBaker"
EXTENSION "${OPTIX_MODULE_EXTENSION}"
GENERATED_FILES PROGRAM_MODULES
NVCC_OPTIONS "${OPTIX_PROGRAM_TARGET}" "--machine=64" "--use_fast_math" "--relocatable-device-code=true" "--generate-line-info" "-Wno-deprecated-gpu-targets" "--allow-unsupported-compiler" "-I${OPTIX_INCLUDE_DIR}" "-I${CMAKE_CURRENT_SOURCE_DIR}/cuda"
)
But there is many compilation errors, it seems that the compiler did not find these optix functions
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 30;: Call to '_optix_get_sbt_data_ptr_64' requires call prototype
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 34;: Call to '_optix_get_payload' requires call prototype
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 38;: Call to '_optix_get_payload' requires call prototype
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 44;: Call to '_optix_read_primitive_idx' requires call prototype
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 53;: Call to '_optix_get_triangle_barycentrics' requires call prototype
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 56;: Call to '_optix_get_triangle_barycentrics' requires call prototype
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 125;: Call to '_optix_get_world_ray_origin_x' requires call prototype
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 128;: Call to '_optix_get_world_ray_origin_y' requires call prototype
ptxas C: Error AppData/Local/Temp/tmpxft_0000c180_00000000-7_EstimateDirect.ptx, line 131;: Call to '_optix_get_world_ray_origin_z' requires call prototype
I hope to get help, thank you very much!