<div dir="ltr">Hi Abhishek,<br><br>There is a much easier way than modifying the code - just specify which GPU is visible to the program by setting the environment variable CUDA_VISIBLE_DEVICES.<br><br>eg. (bash-syntax):<br><br><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><span style="color: #008;" class="styled-by-prettify">export</span><span style="color: #000;" class="styled-by-prettify"> CUDA_VISIBLE_DEVICES</span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #066;" class="styled-by-prettify">0</span><span style="color: #660;" class="styled-by-prettify">,</span><span style="color: #066;" class="styled-by-prettify">3</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #660;" class="styled-by-prettify">...</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #008;" class="styled-by-prettify">then</span><span style="color: #000;" class="styled-by-prettify"> start your calculation </span><span style="color: #660;" class="styled-by-prettify">...</span><span style="color: #000;" class="styled-by-prettify"><br>unset CUDA_VISIBLE_DEVICES<br></span></div></code></div><br>would "hide" GPU 2 and 3 ("C"-counting).<br><br>Regards,<br>Andreas<br></div>