Error when building OptiX

[ 55%] Built target optixPathTracerTiled
[ 57%] Built target optixPrimitiveIndexOffsets
[ 58%] Building NVCC (Device) object lib/ptx/optixRaycasting_generated_optixRaycastingKernels.cu.o
nvcc fatal   : Value 'sm_30' is not defined for option 'gpu-architecture'
CMake Error at optixRaycasting_generated_optixRaycastingKernels.cu.o.cmake:259 (message):
  Error generating
  /home/chartist/NVIDIA-OptiX-SDK-6.5.0-linux64/SDK/lib/ptx/./optixRaycasting_generated_optixRaycastingKernels.cu.o


make[2]: *** [optixRaycasting/CMakeFiles/optixRaycasting.dir/build.make:77: lib/ptx/optixRaycasting_generated_optixRaycastingKernels.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1237: optixRaycasting/CMakeFiles/optixRaycasting.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I don’t know what to do, it just cant build, any advices?

gcc:

$  gcc --version

gcc (Ubuntu 9.5.0-6ubuntu2) 9.5.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cuda:

$ nvcc -V

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Fri_Jan__6_16:45:21_PST_2023
Cuda compilation tools, release 12.0, V12.0.140
Build cuda_12.0.r12.0/compiler.32267302_0

cmake:

$ cmake --version
cmake version 3.28.3

Hi @trianoncentury,

compute capability sm_30 (which is a constant set in CMakeLists.txt) is supported up to CUDA 10.2, you have 12.0.

To know the compute caps of your GPU:

nvidia-smi --query-gpu=compute_cap --format=csv

If your card supports caps newer than sm_30 then change CMakeLists.txt accordingly, otherwise you have to downgrade CUDA.