When I run;
require 'cutorch'
in lua it automatically allocates two processes to two of the cores in my GPU. For example I get the following output in nvidia-smi;
---------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
| 1 6091 C /home/msmith/torch/install/bin/qlua 98MiB |
| 2 6091 C /home/msmith/torch/install/bin/qlua 99MiB |
+-----------------------------------------------------------------------------+
I would like to be able to control which GPU the process goes on. I have tried;
cutorch.setDevice(<Device Number>)
but this just creates more processes on the GPU.
Thanks.
You can control which GPU your process will run on before launching it using the CUDA_VISIBLE_DEVICES environment variable, e.g. to run only on CPU 0:
export CUDA_VISIBLE_DEVICES=0
luajit your-script.lua
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With