CUDA compiler is unable to compile a simple test program

前端 未结 1 1673
傲寒
傲寒 2021-01-23 18:52

I am trying to get NVIDIA\'s CUDA setup and installed on my PC which has an NVIDIA GEFORCE RTX 2080 SUPER graphics card. After hours of trying different things and lots of resea

1条回答
  •  [愿得一人]
    2021-01-23 19:04

    I was able to get a simple "Hello World" compiling in CLion by making sure your PATH is updated to include

    C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0/bin

    My CMakeLists.txt looks like this

    cmake_minimum_required(VERSION 3.17)
    project(cuda_test CUDA)
    
    find_package(CUDA)
    set(CMAKE_CUDA_STANDARD 14)
    
    add_executable(cuda_test main.cu)
    
    set_target_properties(
            cuda_test
            PROPERTIES
            CUDA_SEPARABLE_COMPILATION ON)
    

    And using Visual Studio 2017 with these settings in the toolchain

    0 讨论(0)
提交回复
热议问题