Closed disini closed 1 year ago
My OS is UBUNTU 22.04.2, with cuda 12.2 and optix 7.7, and using a intel 6700k cpu and gtx 1070 gpu.
Try without the "sm_" prefix, i.e.
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 61)
endif(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
Alternatively, if you are using CMake >= 3.20, you could define the environment variable before configuring the project with CMake CUDAARCHS=61
, or passing -DCMAKE_CUDA_ARCHITURES=61
to the cmake command (if invoking on the command-line).
If you are using CMake 3.18, the best might be to call cmake_policy(SET CMP0104 NEW)
, so that the default behaviour is for CMAKE_CUDA_ARCHITURES
to be initialised with the GPU architectures CUDA found in your computer.
Try without the "sm_" prefix, i.e.
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) set(CMAKE_CUDA_ARCHITECTURES 61) endif(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
Alternatively, if you are using CMake >= 3.20, you could define the environment variable before configuring the project with CMake
CUDAARCHS=61
, or passing-DCMAKE_CUDA_ARCHITURES=61
to the cmake command (if invoking on the command-line).If you are using CMake 3.18, the best might be to call
cmake_policy(SET CMP0104 NEW)
, so that the default behaviour is forCMAKE_CUDA_ARCHITURES
to be initialised with the GPU architectures CUDA found in your computer.
Much Appreciated! It works now! Thank you sir!
Hi Mr. Pharr,
Thank you so much for your timely replies!
after some modifies on the CMakeLists.txt, the cmake passed almostly:
but it still has some warnings:
I tried to do make on this result, but the binaries that it maked can't using gpu.
Then I searched for a while, and someone suggests to add the follows :
then I try to make the project again, and it says:
nvcc fatal : Option '--ptx (-ptx)' is not allowed when compiling for multiple GPU architectures
Then I checked the cmake log before , I found the line it output:
-- Detected CUDA Architecture: sm_61
so I tried to replace the value with it instead of 60:
and did the cmake and make again :
the cmake passed as before:
but on the make stage it gives some errors:
so , how should I set the CMAKE_CUDA_ARCHITECTURES value? Many thanks!