blt icon indicating copy to clipboard operation
blt copied to clipboard

how to pass cuda arch settings to blt_cuda_smoke?

Open cyrush opened this issue 6 years ago • 5 comments

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?

cyrush avatar Jun 13 '19 19:06 cyrush

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.

davidbeckingsale avatar Jun 13 '19 19:06 davidbeckingsale

set(CMAKE_CUDA_FLAGS "-arch=sm_60" CACHE STRING "")

fixed it.

we need some examples in the docs and or host configs

cyrush avatar Jun 13 '19 19:06 cyrush

@davidbeckingsale thanks a million!

cyrush avatar Jun 13 '19 19:06 cyrush

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 avatar Jun 27 '19 15:06 mclarsen

@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 "" )

cyrush avatar Jul 09 '19 16:07 cyrush