Using the core caffe cpu core?

Is there a way to limit the use of a Caffe CPU? For my instance, I have a Xeon E5-2699, and I would like to limit Caffe to use 9 cores, so 50 percent of the CPU. Most of the training is done on the GPU, and I have another development that I would like to work on at the same time. Is there an easy way to do this? Launch CentOS

+4
source share
2 answers

I'm not sure how caffe is called, but you can use cgroups to limit CPU usage for processes on centos6 and beyond. An example of CPU usage restriction for 5 logical processors:

sudo mkdir -p /sys/fs/cgroup/cpu/fivecpus
sudo bash -c "echo 500000 > /sys/fs/cgroup/cpu/fivecpus/cpu.cfs_quota_us"
sudo bash -c "echo $$ > /sys/fs/cgroup/cpu/fivecpus/tasks"
your_command

, 500000 5 /sys/fs/cgroup/cpu/fivecpus/cpu.cfs_period_us

0

, - , taskset.

taskset CentOS:

sudo yum install util-linux

/ script 0 8 (9 ):

taskset -c 0,1,2,3,4,5,6,7,8 <your_command>
0

All Articles