facebookresearch / darkforestGo

DarkForest, the Facebook Go engine.
Other
2.1k stars 325 forks source link

high CPU usage of GPU server (local_evaluator) #12

Closed zhu-jz closed 8 years ago

zhu-jz commented 8 years ago

After sh cnn_evaluator.sh 1 /home/zhu/darkforestGo/data/

the CPU usage is 200% all the time, is it normal?

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3840 zhu 20 0 20.935g 357256 87472 R 199.7 4.4 0:48.94 /home/zhu/torch/install/bin/luajit -e package+

then I set opt.use_pondering = false in the function load_params_for_formal_game(), the engine run OK with the command: th cnnPlayerV2/cnnPlayerMCTSV2.lua --use_formal_params --num_gpu 1 --time_limit 10

but the usage of CPU is still 200% when it is not the engine's turn....

yuandong-tian commented 8 years ago

Yes..there is a bug (or a feature?) in --use_pondering. The engine will always ponder before the first move, no matter whether --use_pondering is on or not. After the first move, it should be ok.

zhu-jz commented 8 years ago

Yes, the engine will always ponder before the first move.

But, no matter whether the main program (cnnPlayerMCTSV2.lua) is started, the server side (local_evaluator) always takes 200% of CPU usage.

That is, 1) before the main program (cnnPlayer) is started, local_evaluator has 2 threads work full load. 2) after the main program is started, although --use_pondering is False, and after the first move, the GPU server (local_evaluator) still has 2 threads work full load all the time.

It may not be a feature, I have to kill the GPU server every time manually...

yuandong-tian commented 8 years ago

Oh, ic. that's because local evaluator uses busy wait strategy...If there is no board sent to them, they will keep looping...

zhu-jz commented 8 years ago

thanks!