Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to choose device when running a CUDA executable?

Tags:

cuda

I'm connecting to a GPU cluster from the outside and I have no idea how to select the device on which to run my CUDA programs.

I know there are two Tesla GPU in the cluster, and I'd like to choose one of them.

Any ideas how? How do you choose the device you want to use when there are many connected to your computer?

like image 383
Michael Eilers Smith Avatar asked Jan 09 '12 06:01

Michael Eilers Smith


People also ask

How do I select which GPU to run a job on?

To assign an application to a GPU, head to Settings > System > Display. Scroll down and click the “Graphics Settings” link. Select the application you want to configure.

What does CUDA_VISIBLE_DEVICES 0 mean?

@KurianBenoy setting CUDA_VISIBLE_DEVICE=0 will select GPU 0 to perform any CUDA tasks.

What is function of __ global __ qualifier in CUDA program?

__global__ : 1. A qualifier added to standard C. This alerts the compiler that a function should be compiled to run on a device (GPU) instead of host (CPU).

What is the correct order of CUDA program processing?

In a typical CUDA program, data are first send from main memory to the GPU memory, then the CPU sends instructions to the GPU, then the GPU schedules and executes the kernel on the available parallel hardware, and finally results are copied back from the GPU memory to the CPU memory. ...


1 Answers

You can set the environment variable CUDA_VISIBLE_DEVICES to a comma-separated list of device IDs to make only those devices visible to an application. Use this either to mask out devices or to change the visibility order of devices so that the CUDA runtime enumerates them in a specific order.

like image 173
kynan Avatar answered Oct 26 '22 00:10

kynan