Skip to content

CUDA specific topics

Matia Pizzoli edited this page Nov 15, 2015 · 3 revisions

If you have more than one CUDA-capable GPUs in your system, you can specify which one to use by passing the --device= command-line argument. For instance, to run the example using the GPU identified by ID 1, execute the following:

cd $MY_WORKSPACE/rpg_open_remode/build
./dataset_main --device=1

By default, the GPU identified by ID 0 is used.

You can target the compute capability of your CUDA device by specifying arch=compute_xx,code=sm_x in the CUDA_NVCC_FLAGS.

For instance, for my QuadroK2000M (compute capability 3.0), I add the following flags in the CMakeLists.txt file:

list(APPEND CUDA_NVCC_FLAGS -arch=sm_30)
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
Clone this wiki locally