blt
blt copied to clipboard
how to pass cuda arch settings to blt_cuda_smoke?
Using blt fb5633c (master as of 6/13/19)
I have the following set in a host-config file:
set(CUDA_ARCH "sm_60" CACHE STRING "")
set(CMAKE_CUDA_ARCH "sm_60" CACHE STRING "")
set(CUDA_NVCC_FLAGS "-arch=sm_60" CACHE STRING "")
None of these propgate to the blt_cuda_smoke test, and I end up with an exe that is targeted at sm_30.
bash-4.2$ cuobjdump tests/blt_cuda_smoke
Fatbin elf code:
================
arch = sm_30
code version = [1,7]
producer = cuda
host = linux
compile_size = 64bit
Fatbin ptx code:
================
arch = sm_30
code version = [6,2]
producer = cuda
host = linux
compile_size = 64bit
compressed
Fatbin elf code:
================
arch = sm_30
code version = [1,7]
producer = <unknown>
host = linux
compile_size = 64bit
Not sure how to pass flags?
I think you want CMAKE_CUDA_FLAGS. I don't believe CMAKE_CUDA_ARCH does anything, neither does CUDA_ARCH.
CUDA_NVCC_FLAGS is the old "FindCUDA" variable.
set(CMAKE_CUDA_FLAGS "-arch=sm_60" CACHE STRING "")
fixed it.
we need some examples in the docs and or host configs
@davidbeckingsale thanks a million!
There is an example in the host configs: https://github.com/LLNL/blt/blob/c0e59246ca63b2087593277119e0c6bf8bf34b55/host-configs/llnl-ray-blue_os-clang-coral%402018.08.08.cmake#L61
I think it could be a be a little more clear if we could specify BLT_CUDA_ARCH or something similar.
@mclarsen I agree, but I think in this case, the search was confusing us. It's used right below in the host config. So it's not really even a blt thing.
set (CUDA_ARCH "sm_60" CACHE PATH "")
set (CMAKE_CUDA_FLAGS "-restrict -arch ${CUDA_ARCH} -std=c++11 --expt-extended-lambda -G" CACHE STRING "" )