ingowald / optix7course

Apache License 2.0
452 stars 80 forks source link

Compile error w/ example 11 (‘OPTIX_DENOISER_ALPHA_MODE_ALPHA_AS_AOV’ was not declared in this scope) #34

Closed benjaminchew closed 1 year ago

benjaminchew commented 1 year ago

Hello, I am trying to compile this with the specs:

Ubuntu 20.04 CUDA 11.6 OptiX 7.4 NVIDIA A-100

and getting the error: ‘OPTIX_DENOISER_ALPHA_MODE_ALPHA_AS_AOV’ was not declared in this scope

I am admittedly unfamiliar with C and was wondering how I should go about declaring it.

Building NVCC ptx file example11_denoiseColorOnly/cuda_compile_ptx_1_generated_devicePrograms.cu.ptx
/home/usr/test_dir/optix7course/example11_denoiseColorOnly/devicePrograms.cu(34): warning #20044-D: extern declaration of the entity optixLaunchParams is treated as a static definition

[ 82%] compiling (and embedding ptx from) devicePrograms.cu
Scanning dependencies of target ex11_denoiseColorOnly
[ 83%] Building C object example11_denoiseColorOnly/CMakeFiles/ex11_denoiseColorOnly.dir/cuda_compile_ptx_1_generated_devicePrograms.cu.ptx_embedded.c.o
[ 85%] Building CXX object example11_denoiseColorOnly/CMakeFiles/ex11_denoiseColorOnly.dir/SampleRenderer.cpp.o
/home/usr/test_dir/optix7course/example11_denoiseColorOnly/SampleRenderer.cpp: In member function ‘void osc::SampleRenderer::render()’:
/home/usr/test_dir/optix7course/example11_denoiseColorOnly/SampleRenderer.cpp:630:35: error: ‘OPTIX_DENOISER_ALPHA_MODE_ALPHA_AS_AOV’ was not declared in this scope
  630 |     denoiserParams.denoiseAlpha = OPTIX_DENOISER_ALPHA_MODE_ALPHA_AS_AOV;
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [example11_denoiseColorOnly/CMakeFiles/ex11_denoiseColorOnly.dir/build.make:107: example11_denoiseColorOnly/CMakeFiles/ex11_denoiseColorOnly.dir/SampleRenderer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:718: example11_denoiseColorOnly/CMakeFiles/ex11_denoiseColorOnly.dir/all] Error 2
make: *** [Makefile:104: all] Error 2
ingowald commented 1 year ago

Apologies; I should have catched that myself. The problem is that you are using a slightly older version of OptiX (7.4 or earlier), and that particular flag only appears in OptiX 7.5. I usually do testing against older versions of optix before I push, but some way or another this one line has slipped through. Apologies; I'll push a version soon that'll set that flag only for OptiX 7.5 and above.

ingowald commented 1 year ago

fixed in last push from yesterday