PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.98k stars 4.62k forks source link

[compile error] Cannot cmake configure PCL with CUDA #5737

Closed mynickmynick closed 1 year ago

mynickmynick commented 1 year ago

Describe the error

CUDA_SDK_ROOT_DIR was not found

BUILD_GPU BUILD_CUDA and WITH_CUDA are set true

with MS 2022 the log i get is too long doesn't fit here

With MSVS2019 the log is shorter:

1> CMake generation started for configuration: 'x64-Release'. 1> Found and using vcpkg toolchain file (C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake). 1> Command line: "C:\Windows\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="D:\U\Cdev\C++\repo\external\forks\pcl\out\install\x64-Release" -DBUILD_CUDA:BOOL="True" -DVTK_DIR:PATH="C:/Users/User/source/repos/VTK/out/install/x64-Release" -DBUILD_visualization:BOOL="True" -DWITH_OPENMP:BOOL="True" -DQhull_DIR:PATH="D:/U/Cdev/C++/repo/external/forks/qhull/out/install/x64-Release" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake" "D:\U\Cdev\C++\repo\external\forks\pcl" 2>&1" 1> Working directory: D:\U\Cdev\C++\repo\external\forks\pcl\out\build\x64-Release 1> [CMake] -- The C compiler identification is MSVC 19.29.30148.0 1> [CMake] -- The CXX compiler identification is MSVC 19.29.30148.0 1> [CMake] -- Detecting C compiler ABI info 1> [CMake] -- Detecting C compiler ABI info - done 1> [CMake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped 1> [CMake] -- Detecting C compile features 1> [CMake] -- Detecting C compile features - done 1> [CMake] -- Detecting CXX compiler ABI info 1> [CMake] -- Detecting CXX compiler ABI info - done 1> [CMake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped 1> [CMake] -- Detecting CXX compile features 1> [CMake] -- Detecting CXX compile features - done 1> [CMake] -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 1> [CMake] -- Performing Test LIBATOMIC_NOT_NEEDED 1> [CMake] -- Performing Test LIBATOMIC_NOT_NEEDED - Success 1> [CMake] -- Could NOT find ClangFormat (missing: ClangFormat_EXECUTABLE ClangFormat_VERSION) (Required is at least version "14") 1> [CMake] -- Performing Test HAVE_MM_MALLOC 1> [CMake] -- Performing Test HAVE_MM_MALLOC - Failed 1> [CMake] -- Performing Test HAVE_POSIX_MEMALIGN 1> [CMake] -- Performing Test HAVE_POSIX_MEMALIGN - Failed 1> [CMake] -- Performing Test HAVE_SSE4_2_EXTENSIONS 1> [CMake] -- Performing Test HAVE_SSE4_2_EXTENSIONS - Success 1> [CMake] -- Performing Test HAVE_AVX2 1> [CMake] -- Performing Test HAVE_AVX2 - Success 1> [CMake] -- Found Boost: C:/Users/User/vcpkg/vcpkg/installed/x64-windows/include (found version "1.81.0")
1> [CMake] BOOST FOUND 1> [CMake] -- Found OpenMP_C: -openmp (found version "2.0") 1> [CMake] -- Found OpenMP_CXX: -openmp (found version "2.0") 1> [CMake] -- Found OpenMP: TRUE (found version "2.0") found components: C CXX 1> [CMake] -- Found OpenMP, spec date 200203 1> [CMake] -- Looking for pthread.h 1> [CMake] -- Looking for pthread.h - not found 1> [CMake] -- Found Threads: TRUE
1> [CMake] -- Found Eigen: C:/Users/User/vcpkg/vcpkg/installed/x64-windows/include/eigen3 (Required is at least version "3.3") 1> [CMake] -- Eigen found (include: C:/Users/User/vcpkg/vcpkg/installed/x64-windows/include/eigen3, version: 3.4.0) 1> [CMake] -- Found flann version 1.9.1 1> [CMake] -- Could NOT find libusb (missing: libusb_LIBRARIES libusb_INCLUDE_DIR) 1> [CMake] -- Could NOT find libusb (missing: LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS) 1> [CMake] -- Could NOT find OpenNI (missing: OPENNI_LIBRARIES OPENNI_INCLUDE_DIRS) 1> [CMake] -- OpenNI grabber support: not building because OpenNI not found 1> [CMake] -- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARIES OPENNI2_INCLUDE_DIRS) 1> [CMake] -- OpenNI2 grabber support: not building because OpenNI2 not found 1> [CMake] -- Could NOT find Ensenso (missing: ENSENSO_LIBRARIES ENSENSO_INCLUDE_DIRS) 1> [CMake] -- IDS-Imaging Ensenso camera support: not building because Ensenso not found 1> [CMake] -- Could NOT find davidSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR) 1> [CMake] -- David Vision Systems SDK support: not building because davidSDK not found 1> [CMake] -- Could NOT find DSSDK (missing: DSSDK_LIBRARIES DSSDK_INCLUDE_DIRS) 1> [CMake] -- DepthSense SDK support: not building because DSSDK not found 1> [CMake] -- Could NOT find RSSDK (missing: RSSDK_LIBRARIES RSSDK_INCLUDE_DIRS) 1> [CMake] -- RealSense SDK support: not building because RSSDK not found 1> [CMake] -- RealSense SDK 2 found (include: C:/Users/User/vcpkg/vcpkg/installed/x64-windows/include, lib: realsense2::realsense2, version: 2.51.1) 1> [CMake] -- Found ZLIB: optimized;C:/Users/User/vcpkg/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/User/vcpkg/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.12") 1> [CMake] -- Found PNG: optimized;C:/Users/User/vcpkg/vcpkg/installed/x64-windows/lib/libpng16.lib;debug;C:/Users/User/vcpkg/vcpkg/installed/x64-windows/debug/lib/libpng16d.lib (found version "1.6.37") 1> [CMake] -- Found Qhull version 8.1-alpha3 1> [CMake] -- Found CUDA Toolkit v12.1 1> [CMake] -- The CUDA compiler identification is unknown 1> [CMake] -- Detecting CUDA compiler ABI info 1> [CMake] -- Detecting CUDA compiler ABI info - failed 1> [CMake] -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe 1> [CMake] -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe - broken 1> [CMake] CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/CMakeTestCUDACompiler.cmake:52 (message): 1> [CMake] The CUDA compiler 1> [CMake] 1> [CMake] "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe" 1> [CMake] 1> [CMake] is not able to compile a simple test program. 1> [CMake] 1> [CMake] It fails with the following output: 1> [CMake] 1> [CMake] Change Dir: D:/U/Cdev/C++/repo/external/forks/pcl/out/build/x64-Release/CMakeFiles/CMakeTmp 1> [CMake]
1> [CMake] Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_9333d && [1/2] Building CUDA object CMakeFiles\cmTC_9333d.dir\main.cu.obj 1> [CMake] FAILED: CMakeFiles/cmTC_9333d.dir/main.cu.obj 1> [CMake] C:\PROGRA~1\NVIDIA~2\CUDA\v12.1\bin\nvcc.exe -c main.cu -o CMakeFiles\cmTC_9333d.dir\main.cu.obj 1> [CMake] nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat' 1> [CMake] ninja: build stopped: subcommand failed. 1> [CMake]
1> [CMake]
1> [CMake] 1> [CMake]
1> [CMake] 1> [CMake] CMake will not be able to correctly generate this project. 1> [CMake] Call Stack (most recent call first): 1> [CMake] cmake/pcl_find_cuda.cmake:13 (enable_language) 1> [CMake] CMakeLists.txt:392 (include) 1> [CMake] -- Configuring incomplete, errors occurred! 1> [CMake] See also "D:/U/Cdev/C++/repo/external/forks/pcl/out/build/x64-Release/CMakeFiles/CMakeOutput.log". 1> [CMake] See also "D:/U/Cdev/C++/repo/external/forks/pcl/out/build/x64-Release/CMakeFiles/CMakeError.log". 1> 'C:\Windows\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="D:\U\Cdev\C++\repo\external\forks\pcl\out\install\x64-Release" -DBUILD_CUDA:BOOL="True" -DVTK_DIR:PATH="C:/Users/User/source/repos/VTK/out/install/x64-Release" -DBUILD_visualization:BOOL="True" -DWITH_OPENMP:BOOL="True" -DQhull_DIR:PATH="D:/U/Cdev/C++/repo/external/forks/qhull/out/install/x64-Release" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake" "D:\U\Cdev\C++\repo\external\forks\pcl" 2>&1"' execution failed with error: ''C:\Windows\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="D:\U\Cdev\C++\repo\external\forks\pcl\out\install\x64-Release" -DBUILD_CUDA:BOOL="True" -DVTK_DIR:PATH="C:/Users/User/source/repos/VTK/out/install/x64-Release" -DBUILD_visualization:BOOL="True" -DWITH_OPENMP:BOOL="True" -DQhull_DIR:PATH="D:/U/Cdev/C++/repo/external/forks/qhull/out/install/x64-Release" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake" "D:\U\Cdev\C++\repo\external\forks\pcl" 2>&1"' returned with exit code: 1'.

If PCL was compiled from source or failure in compiling PCL itself:

mynickmynick commented 1 year ago

if I clone the master pcl i get same errors: i print screen underneath the config

1> CMake generation started for configuration: 'x64-Debug'. 1> Found and using vcpkg toolchain file (C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake). 1> Command line: "C:\Windows\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\User\source\repos\pcl\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake" "C:\Users\User\source\repos\pcl" 2>&1" 1> Working directory: C:\Users\User\source\repos\pcl\out\build\x64-Debug 1> [CMake] -- The C compiler identification is MSVC 19.29.30148.0 1> [CMake] -- The CXX compiler identification is MSVC 19.29.30148.0 1> [CMake] -- Detecting C compiler ABI info 1> [CMake] -- Detecting C compiler ABI info - done 1> [CMake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped 1> [CMake] -- Detecting C compile features 1> [CMake] -- Detecting C compile features - done 1> [CMake] -- Detecting CXX compiler ABI info 1> [CMake] -- Detecting CXX compiler ABI info - done 1> [CMake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped 1> [CMake] -- Detecting CXX compile features 1> [CMake] -- Detecting CXX compile features - done 1> [CMake] -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 1> [CMake] -- Performing Test LIBATOMIC_NOT_NEEDED 1> [CMake] -- Performing Test LIBATOMIC_NOT_NEEDED - Success 1> [CMake] -- Could NOT find ClangFormat (missing: ClangFormat_EXECUTABLE ClangFormat_VERSION) (Required is at least version "14") 1> [CMake] -- Performing Test HAVE_MM_MALLOC 1> [CMake] -- Performing Test HAVE_MM_MALLOC - Failed 1> [CMake] -- Performing Test HAVE_POSIX_MEMALIGN 1> [CMake] -- Performing Test HAVE_POSIX_MEMALIGN - Failed 1> [CMake] -- Performing Test HAVE_SSE4_2_EXTENSIONS 1> [CMake] -- Performing Test HAVE_SSE4_2_EXTENSIONS - Success 1> [CMake] -- Performing Test HAVE_AVX2 1> [CMake] -- Performing Test HAVE_AVX2 - Success 1> [CMake] -- Found OpenMP_C: -openmp (found version "2.0") 1> [CMake] -- Found OpenMP_CXX: -openmp (found version "2.0") 1> [CMake] -- Found OpenMP: TRUE (found version "2.0") found components: C CXX 1> [CMake] -- Found OpenMP, spec date 200203 1> [CMake] -- Looking for pthread.h 1> [CMake] -- Looking for pthread.h - not found 1> [CMake] -- Found Threads: TRUE
1> [CMake] -- Found Eigen: C:/Users/User/vcpkg/vcpkg/installed/x64-windows/include/eigen3 (Required is at least version "3.3") 1> [CMake] -- Eigen found (include: C:/Users/User/vcpkg/vcpkg/installed/x64-windows/include/eigen3, version: 3.4.0) 1> [CMake] -- Found flann version 1.9.1 1> [CMake] -- Could NOT find libusb (missing: libusb_LIBRARIES libusb_INCLUDE_DIR) 1> [CMake] -- Could NOT find libusb (missing: LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS) 1> [CMake] -- Could NOT find OpenNI (missing: OPENNI_LIBRARIES OPENNI_INCLUDE_DIRS) 1> [CMake] -- OpenNI grabber support: not building because OpenNI not found 1> [CMake] -- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARIES OPENNI2_INCLUDE_DIRS) 1> [CMake] -- OpenNI2 grabber support: not building because OpenNI2 not found 1> [CMake] -- Could NOT find Ensenso (missing: ENSENSO_LIBRARIES ENSENSO_INCLUDE_DIRS) 1> [CMake] -- IDS-Imaging Ensenso camera support: not building because Ensenso not found 1> [CMake] -- Could NOT find davidSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR) 1> [CMake] -- David Vision Systems SDK support: not building because davidSDK not found 1> [CMake] -- Could NOT find DSSDK (missing: DSSDK_LIBRARIES DSSDK_INCLUDE_DIRS) 1> [CMake] -- DepthSense SDK support: not building because DSSDK not found 1> [CMake] -- Could NOT find RSSDK (missing: RSSDK_LIBRARIES RSSDK_INCLUDE_DIRS) 1> [CMake] -- RealSense SDK support: not building because RSSDK not found 1> [CMake] -- RealSense SDK 2 found (include: C:/Users/User/vcpkg/vcpkg/installed/x64-windows/include, lib: realsense2::realsense2, version: 2.51.1) 1> [CMake] -- Found ZLIB: optimized;C:/Users/User/vcpkg/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Users/User/vcpkg/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.12") 1> [CMake] -- Found PNG: optimized;C:/Users/User/vcpkg/vcpkg/installed/x64-windows/lib/libpng16.lib;debug;C:/Users/User/vcpkg/vcpkg/installed/x64-windows/debug/lib/libpng16d.lib (found version "1.6.37") 1> [CMake] -- Found Qhull version 8.1-alpha3 1> [CMake] -- Found CUDA Toolkit v12.1 1> [CMake] -- The CUDA compiler identification is unknown 1> [CMake] -- Detecting CUDA compiler ABI info 1> [CMake] -- Detecting CUDA compiler ABI info - failed 1> [CMake] -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe 1> [CMake] -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe - broken 1> [CMake] CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/CMakeTestCUDACompiler.cmake:52 (message): 1> [CMake] The CUDA compiler 1> [CMake] 1> [CMake] "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe" 1> [CMake] 1> [CMake] is not able to compile a simple test program. 1> [CMake] 1> [CMake] It fails with the following output: 1> [CMake] 1> [CMake] Change Dir: C:/Users/User/source/repos/pcl/out/build/x64-Debug/CMakeFiles/CMakeTmp 1> [CMake]
1> [CMake] Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_d1908 && [1/2] Building CUDA object CMakeFiles\cmTC_d1908.dir\main.cu.obj 1> [CMake] FAILED: CMakeFiles/cmTC_d1908.dir/main.cu.obj 1> [CMake] C:\PROGRA~1\NVIDIA~2\CUDA\v12.1\bin\nvcc.exe -c main.cu -o CMakeFiles\cmTC_d1908.dir\main.cu.obj 1> [CMake] nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat' 1> [CMake] ninja: build stopped: subcommand failed. 1> [CMake]
1> [CMake]
1> [CMake] 1> [CMake]
1> [CMake] 1> [CMake] CMake will not be able to correctly generate this project. 1> [CMake] Call Stack (most recent call first): 1> [CMake] cmake/pcl_find_cuda.cmake:13 (enable_language) 1> [CMake] CMakeLists.txt:381 (include) 1> [CMake] -- Configuring incomplete, errors occurred! 1> [CMake] See also "C:/Users/User/source/repos/pcl/out/build/x64-Debug/CMakeFiles/CMakeOutput.log". 1> [CMake] See also "C:/Users/User/source/repos/pcl/out/build/x64-Debug/CMakeFiles/CMakeError.log". 1> 'C:\Windows\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\User\source\repos\pcl\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake" "C:\Users\User\source\repos\pcl" 2>&1"' execution failed with error: ''C:\Windows\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\User\source\repos\pcl\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake" "C:\Users\User\source\repos\pcl" 2>&1"' returned with exit code: 1'.

image

larshg commented 1 year ago

I'm currently running with Cuda 11.8 and it works fine. You could try reinstall that version. I'll also try 12.1. But I don't think this is a PCL issue per se. Since it goes back to 'enable_language(cuda)' call. You could test a minimal cuda example as well?

mynickmynick commented 1 year ago

i am trying now on another computer where I have cuda 11.6 and I get basically the same errors. including the CUDA_SDK_ROOT_DIR-NOT FOUND which I don't know how to set manually (I mean I don't know which path is correct)

Since it goes back to 'enable_language(cuda)' call.

i don't understand what you mean

yes later i will probably try to compile a simple program

mynickmynick commented 1 year ago

i have downloaded and compiled 172 out of 186 sample projects from https://github.com/nvidia/cuda-samples and ran a few of them 14 are giving errors like Cannot open include file: 'FreeImage.h': No such file or directory Cannot open include file: 'mpi.h': No such file or directory simpleD3D10RenderTarget_kernel.cu(53): error : texture is not a template error : no instance of overloaded function "tex2D" matches the argument list error : identifier "cudaBindTextureToArray" is undefined

but they come with a MSVS solution .sln

so my problem might be in the cmake project config.

@larshg are you using linux? which IDE?

larshg commented 1 year ago

No, I'm on windows normally running VS2022.

mynickmynick commented 1 year ago

how does your CUDA_SDK_ROOT_DIR look like?

mynickmynick commented 1 year ago

it errors at

enable_language(CUDA)

with

1> [CMake] -- The CUDA compiler identification is unknown 1> [CMake] -- Detecting CUDA compiler ABI info 1> [CMake] -- Detecting CUDA compiler ABI info - failed 1> [CMake] -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe 1> [CMake] -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe - broken 1> [CMake] CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/CMakeTestCUDACompiler.cmake:52 (message): 1> [CMake] The CUDA compiler 1> [CMake] 1> [CMake] "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe" 1> [CMake] 1> [CMake] is not able to compile a simple test program. 1> [CMake] 1> [CMake] It fails with the following output: 1> [CMake] 1> [CMake] Change Dir: D:/U/Cdev/C++/repo/external/forks/pcl/out/build/x64-Release/CMakeFiles/CMakeTmp 1> [CMake]
1> [CMake] Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_7eb44 && [1/2] Building CUDA object CMakeFiles\cmTC_7eb44.dir\main.cu.obj 1> [CMake] FAILED: CMakeFiles/cmTC_7eb44.dir/main.cu.obj 1> [CMake] C:\PROGRA~1\NVIDIA~2\CUDA\v12.1\bin\nvcc.exe -c main.cu -o CMakeFiles\cmTC_7eb44.dir\main.cu.obj 1> [CMake] nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat' 1> [CMake] ninja: build stopped: subcommand failed. 1> [CMake]
1> [CMake]
1> [CMake] 1> [CMake]
1> [CMake] 1> [CMake] CMake will not be able to correctly generate this project. 1> [CMake] Call Stack (most recent call first): 1> [CMake] cmake/pcl_find_cuda.cmake:16 (enable_language) 1> [CMake] CMakeLists.txt:392 (include) 1> [CMake] -- Configuring incomplete, errors occurred! 1> [CMake] See also "D:/U/Cdev/C++/repo/external/forks/pcl/out/build/x64-Release/CMakeFiles/CMakeOutput.log". 1> [CMake] See also "D:/U/Cdev/C++/repo/external/forks/pcl/out/build/x64-Release/CMakeFiles/CMakeError.log". 1> 'C:\Windows\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="D:\U\Cdev\C++\repo\external\forks\pcl\out\install\x64-Release" -DBUILD_CUDA:BOOL="True" -DVTK_DIR:PATH="C:/Users/User/source/repos/VTK/out/install/x64-Release" -DBUILD_visualization:BOOL="True" -DWITH_OPENMP:BOOL="True" -DQhull_DIR:PATH="D:/U/Cdev/C++/repo/external/forks/qhull/out/install/x64-Release" -DCUDA_USE_STATIC_CUDA_RUNTIME:BOOL="True" -DWITH_CUDA:BOOL="True" -DWITH_DOCS:BOOL="True" -DBUILD_examples:BOOL="True" -DBUILD_global_tests:BOOL="True" -DBUILD_GPU:BOOL="True" -DCUDA_SDK_ROOT_DIR:PATH="" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake" "D:\U\Cdev\C++\repo\external\forks\pcl" 2>&1"' execution failed with error: ''C:\Windows\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="D:\U\Cdev\C++\repo\external\forks\pcl\out\install\x64-Release" -DBUILD_CUDA:BOOL="True" -DVTK_DIR:PATH="C:/Users/User/source/repos/VTK/out/install/x64-Release" -DBUILD_visualization:BOOL="True" -DWITH_OPENMP:BOOL="True" -DQhull_DIR:PATH="D:/U/Cdev/C++/repo/external/forks/qhull/out/install/x64-Release" -DCUDA_USE_STATIC_CUDA_RUNTIME:BOOL="True" -DWITH_CUDA:BOOL="True" -DWITH_DOCS:BOOL="True" -DBUILD_examples:BOOL="True" -DBUILD_global_tests:BOOL="True" -DBUILD_GPU:BOOL="True" -DCUDA_SDK_ROOT_DIR:PATH="" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/User/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake" "D:\U\Cdev\C++\repo\external\forks\pcl" 2>&1"' returned with exit code: 1'.

larshg commented 1 year ago

According the log it finds NVCC here: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe

But tries to use the nvcc when compiling the example, from here: C:\PROGRA1\NVIDIA2\CUDA\v12.1\bin\nvcc.exe

That seems odd?

larshg commented 1 year ago

What if you use CMake(Gui) to generate a normal VS solution - does that work?

mynickmynick commented 1 year ago

According the log it finds NVCC here: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe

But tries to use the nvcc when compiling the example, from here: C:\PROGRA1\NVIDIA2\CUDA\v12.1\bin\nvcc.exe

That seems odd?

yeah odd

i don't know this is a relatively new PC that had already something installed by NVIDIA and I have installed recently cuda_12.1.1_531.14_windows.exe and w_dpcpp-cpp-compiler_p_2023.1.0.46350.exe

i guess something is messed up

but also the older laptop gives similar errors.... I am confused

mynickmynick commented 1 year ago

What if you use CMake(Gui) to generate a normal VS solution - does that work?

i don't remember the last time i did that ;)

larshg commented 1 year ago

I have just installed cuda_12.1.1_531.14_windows.exe 👍

mynickmynick commented 1 year ago

C:\PROGRA1\NVIDIA2\CUDA\v12.1\bin might be just an odd way of windows of shortening paths DOS like.... there are "tilde" also that are not correctly pasted here on github

larshg commented 1 year ago

What if you run "where nvcc" in a CMD - what does it show?

larshg commented 1 year ago

I currently have: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc.exe

larshg commented 1 year ago

And: nvcc --version prints: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Mon_Apr__3_17:36:15_Pacific_Daylight_Time_2023 Cuda compilation tools, release 12.1, V12.1.105 Build cuda_12.1.r12.1/compiler.32688072_0

larshg commented 1 year ago

Cmake output:

1> [CMake] -- Found CUDA Toolkit v12.1 1> [CMake] -- The CUDA compiler identification is NVIDIA 12.1.105 1> [CMake] -- Detecting CUDA compiler ABI info 1> [CMake] -- Detecting CUDA compiler ABI info - done 1> [CMake] -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe - skipped 1> [CMake] -- Detecting CUDA compile features 1> [CMake] -- Detecting CUDA compile features - done 1> [CMake] -- CMAKE_CUDA_ARCHITECTURES: 86

I have specified CUDA_ARCHITECTURES to 86, so I don't build for all.

larshg commented 1 year ago

Yours print: 1> [CMake] -- The CUDA compiler identification is unknown

At first line, so it doesn't find it correctly. Could be some multiple installs / (env)paths going wrong.

mynickmynick commented 1 year ago

may be or also if i run by powershell

PS C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build> C:\PROGRA~1\NVIDIA~2\CUDA\v12.1\bin\nvcc.exe -c main.cu -o CMakeFiles\cmTC_5b46b.dir\main.cu.obj nvcc fatal : Cannot find compiler 'cl.exe' in PATH

larshg commented 1 year ago

image My values in path environment variable. First one will be found first, ie. v12.1.

larshg commented 1 year ago

image

Other Env variables set by the installation.

mynickmynick commented 1 year ago

i have those settings too

i am looking for cl.exe and cannot find it

larshg commented 1 year ago

IF you open and search for "x64 native tools" then you can open a VS setup CMD. If you the type where cl.exe, it should show it.

larshg commented 1 year ago

image

mynickmynick commented 1 year ago

yeah i found it C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64

mynickmynick commented 1 year ago

and now what?? ;) I think i ll give up for now, such a mess

i added the path, no change

mynickmynick commented 1 year ago

What if you run "where nvcc" in a CMD - what does it show?

C:\Users\User>where nvcc C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc.exe

C:\Users\User>nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Mon_Apr__3_17:36:15_Pacific_Daylight_Time_2023 Cuda compilation tools, release 12.1, V12.1.105 Build cuda_12.1.r12.1/compiler.32688072_0

mynickmynick commented 1 year ago

may be the fact that ihave MS VS 2019 and 2022 installed at the same time is a problem

this would be the first time i have a probem for that

mynickmynick commented 1 year ago

@larshg could you please tell me what value you have of

CUDA_SDK_ROOT_DIR ?

image

larshg commented 1 year ago

image

NOT-FOUND 😁

larshg commented 1 year ago

Why do you have CMAKE_CUDA_STANDARD 17 ? PCL is only 14 at least for normaly c++ - it is at least set to 14 for CUDA as well in PCL.

larshg commented 1 year ago

What is your CUDA_ARCH_BIN set to?

larshg commented 1 year ago

Ahh, maybe its not set yet, due to the error it encouters...

mynickmynick commented 1 year ago

Why do you have CMAKE_CUDA_STANDARD 17 ? PCL is only 14 at least for normaly c++ - it is at least set to 14 for CUDA as well in PCL.

i am using 17 on my fork but i am now compiling a clone of the master pcl and gives the same issues

mynickmynick commented 1 year ago

@larshg could you please tell me what you have installed of NVDIA visible at control panel->Programs and features ?

mynickmynick commented 1 year ago

on reinstalling from scratch i get as before duely noted:

Installed:

mynickmynick commented 1 year ago

i can compile and run cuda samples .sln but I cannot cmake confgure even a simple cmake project like this

https://dominoc925.blogspot.com/2021/03/creating-simple-cuda-with-cmake-c.html

D:\U\Cdev\C++\repo\Cpp\self-learn\CUDA\CMakeProject1\out\build\x64-debug\CMakeFiles\3.26.0-msvc3\CompilerIdCUDA>if 1> [CMake] "" NEQ "" goto :clean_env 1> [CMake] 1> [CMake] The input line is too long. 1> [CMake] 1> [CMake] The syntax of the command is incorrect. 1> [CMake] 1> [CMake] 1> [CMake] D:\U\Cdev\C++\repo\Cpp\self-learn\CUDA\CMakeProject1\out\build\x64-debug\CMakeFiles\3.26.0-msvc3\CompilerIdCUDA>set 1> [CMake] "PATH=C:\Program Files\Microsoft Visual 1> [CMake] Studio\2022\Community\MSBuild\Current\bin\Roslyn;at"#$ C:/Program 1> [CMake] Files/Microsoft Visual 1> [CMake] Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat 1> [CMake] 1> [CMake] 1> [CMake] nvcc fatal : Could not set up the environment for Microsoft Visual Studio 1> [CMake] using 'C:/Program Files/Microsoft Visual 1> [CMake] Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat' 1> [CMake] 1> [CMake] 1> [CMake] 1> [CMake] 1> [CMake] 1> [CMake] 1> [CMake] Call Stack (most recent call first): 1> [CMake] C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD) 1> [CMake] C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test) 1> [CMake] C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID) 1> [CMake] CMakeLists.txt:8 (project) 1> [CMake] -- Configuring incomplete, errors occurred! 1> 'C:\Windows\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_C_COMPILER:STRING="cl.exe" -DCMAKE_CXX_COMPILER:STRING="cl.exe" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:/U/Cdev/C++/repo/Cpp/self-learn/CUDA/CMakeProject1/out/install/x64-debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\U\Cdev\C++\repo\Cpp\self-learn\CUDA\CMakeProject1" 2>&1"' execution failed with error: ''C:\Windows\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_C_COMPILER:STRING="cl.exe" -DCMAKE_CXX_COMPILER:STRING="cl.exe" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="D:/U/Cdev/C++/repo/Cpp/self-learn/CUDA/CMakeProject1/out/install/x64-debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\U\Cdev\C++\repo\Cpp\self-learn\CUDA\CMakeProject1" 2>&1"' returned with exit code: 1'.

so annoying

mynickmynick commented 1 year ago

i see that if i take off from path this cl.exe is not run C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\ia32_win\compiler;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler;C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\ia32\vc_mt\;C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64\vc_mt\;

mynickmynick commented 1 year ago

1> [CMake] -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe - skipped 1> [CMake] -- Detecting CUDA compile features 1> [CMake] -- Detecting CUDA compile features - done 1> [CMake] -- CMAKE_CUDA_ARCHITECTURES: 86 I have specified CUDA_ARCHITECTURES to 86, so I don't build for all.

i wonder why you have Check for working CUDA compiler: skipped

how did you specify CUDA_ARCHITECTURES to 86

larshg commented 1 year ago

I do it after the first cmake parse, adding the field CUDA_ARCH_BIN: image

larshg commented 1 year ago

You can try run the cmake with --debug-output - maybe it can give some hints to what goes wrong.

mynickmynick commented 1 year ago

i am now trying to compile on ubuntu vbox (it's something i wanted to do anyway). I guess I am having some HW or driver issue because also the CUDA samples were not working until I plugged the video on the NVIDIA board instead of the other PC board. I see these CUDA libs depend a lot on the HW. I was getting weird errros on the sample solutions before.

mynickmynick commented 1 year ago

You can try run the cmake with --debug-output - maybe it can give some hints to what goes wrong.

i think VS2022 is already set for debug-output as it spams a huge amount of output

larshg commented 1 year ago

You can try run the cmake with --debug-output - maybe it can give some hints to what goes wrong.

i think VS2022 is already set for debug-output as it spams a huge amount of output

I don't agree. You'll get more cmake tracing, ie where the calls come from:

1> CMake generation started for configuration: 'x64-Debug'.
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\dev\cudatest\out\install\x64-Debug" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe" --debug-output -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\dev\cudatest" 2>&1"
1> Working directory: C:\dev\cudatest\out\build\x64-Debug
1> [CMake] Running with debug output on.
1> [CMake] -- The CXX compiler identification is MSVC 19.36.32532.0
1> [CMake]    Called from: [3]  C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake
1> [CMake]                 [2]  C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeDetermineCXXCompiler.cmake
1> [CMake]                 [1]  C:/dev/cudatest/CMakeLists.txt
1> [CMake] -- The CUDA compiler identification is NVIDIA 12.1.105
1> [CMake]    Called from: [3]  C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake
1> [CMake]                 [2]  C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.26/Modules/CMakeDetermineCUDACompiler.cmake
1> [CMake]                 [1]  C:/dev/cudatest/CMakeLists.txt
larshg commented 1 year ago

Heh, I know the feeling 😄

I haven't compiled on linux lately and not with qt6, so I haven't seen that error before.

larshg commented 1 year ago

If you don't need QT - you could disable that part for now 😄

larshg commented 1 year ago

If you open a x64 developer CMD promt and run: where cl.exe where nvcc.exe

What do you get? I have: image

larshg commented 1 year ago

According to this issue, they can set the CMAKE_CUDA_COMPILER before enable_language(cuda), ie you can do it early in the main CMakelists of PCL.

mynickmynick commented 1 year ago

If you open a x64 developer CMD promt and run: where cl.exe where nvcc.exe

What do you get? I have: image

Microsoft Windows [Version 10.0.19045.2965] (c) Microsoft Corporation. All rights reserved.

C:\Users\User>where cl.exe C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\Hostx64\x64\cl.exe C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe

C:\Users\User>where nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc.exe

C:\Users\User>

mynickmynick commented 1 year ago

According to this issue, they can set the CMAKE_CUDA_COMPILER before enable_language(cuda), ie you can do it early in the main CMakelists of PCL.

I have set it but still in error:

if(CUDA_FOUND) message(STATUS "Found CUDA Toolkit v${CUDA_VERSION_STRING}") set(CMAKE_CUDA_COMPILER "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe") enable_language(CUDA) set(HAVE_CUDA TRUE)