# Tesla & Quadro with OPTIMUS

**URL:** <https://forums.developer.nvidia.com/t/tesla-quadro-with-optimus/26770>\
**Category:** CUDA Programming and Performance\
**Created:** [May 29, 2012, 2:34pm UTC](https://forums.developer.nvidia.com/t/tesla-quadro-with-optimus/26770 "2012-05-29T14:34:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kklucid](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kklucid/32/44921_2.png) [@kklucid](https://forums.developer.nvidia.com/u/kklucid)\
**Post date:** [May 29, 2012, 2:34pm UTC](https://forums.developer.nvidia.com/t/tesla-quadro-with-optimus/26770/1 "2012-05-29T14:34:22Z")

</div>

Dear all CUDA experts

I have a system with Quadro6000 and Tesla C2075 cards inside.

When I scan the system for CUDA capable devices, Quadro 6000 is coming at 0th place where as Tesla at 1.

Other systems where I my application runs have only one CUDA capable device.

What should I do If I want to offload all CUDA calculations automatically to Tesla while use Quadro only for rendering.

I reconstruct huge 3D volume and I use vtk’s GPURasyCast mapper to update the image on the screen which it automatically uses Quadro.

I’m looking for a solution where I no need to explicitly call cudaSetDevice(TeslaDevice). It’s mentioned that nVidia OPTIMUS technology will handle this automatically(not sure) but in my case, If I don’t explicitly change the device number via cudaSetDevice, all my CUDA kernels are executed on Quadro include GPU based ray-cast algorithms from VTK while Tesla is sitting idle.

Please help me how to automatically offload CUDA calculations to Tesla?

---

<div class="post-metadata">

**Author:** ![Gilles\_C](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Gilles\_C](https://forums.developer.nvidia.com/u/Gilles_C)\
**Post date:** [May 29, 2012, 2:55pm UTC](https://forums.developer.nvidia.com/t/tesla-quadro-with-optimus/26770/2 "2012-05-29T14:55:04Z")

</div>

```auto
$ export CUDA_VISIBLE_DEVICES=1

```

---

<div class="post-metadata">

**Author:** ![kklucid](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kklucid/32/44921_2.png) [@kklucid](https://forums.developer.nvidia.com/u/kklucid)\
**Post date:** [May 30, 2012, 9:45am UTC](https://forums.developer.nvidia.com/t/tesla-quadro-with-optimus/26770/3 "2012-05-30T09:45:46Z")

</div>

I’m using Windows 7 64-bit.

How does this flag affects the CUDA device detection and kernel offload to Tesla instead of Quadro?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![pasoleatis](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pasoleatis](https://forums.developer.nvidia.com/u/pasoleatis)\
**Post date:** [May 31, 2012, 5:49pm UTC](https://forums.developer.nvidia.com/t/tesla-quadro-with-optimus/26770/4 "2012-05-31T17:49:03Z")

</div>

If you have an execcutable in Windows with optimus, if you do right click on the executable you should have an optio run with the one f the nvidia gpu. If you have 2 cards one gets the id 0 and the other id 1. In the code you have to use cudasetdevice function in order to make it run on a specific device. If you do not set that it will automatically run on device 0.

---

<div class="post-metadata">

**Author:** ![kklucid](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kklucid/32/44921_2.png) [@kklucid](https://forums.developer.nvidia.com/u/kklucid)\
**Post date:** [June 6, 2012, 7:26am UTC](https://forums.developer.nvidia.com/t/tesla-quadro-with-optimus/26770/5 "2012-06-06T07:26:26Z")

</div>

On my system Quadro is assigned device id 0 and Tesla device id 1.

I have CUDA modules which were developed some time back with only one GPU in the system. These modules are by-default using device with id =0 (call to CudaSetDevice(0)). Now do I need to explicitly change the code to use the Tesla device?

I read in some article that with OPTIMUS technology, all CUDA calculations are automatically off-loaded to Tesla irrespective of which device we set  
via CudaSetDevice()? Is it true?

Thanks in advance for your replies.
