2024年6月

CPU使用率高
./build/examples/alpha_zero_torch_example --game=new_game --actors=28 --evaluators=4 --inference_threads=4 --inference_batch_size=1 --train_batch_size=1024 --inference_cache=2621440 --max_simulations=100 --path=./point --checkpoint_freq=10 --max_steps=100 --verbose=false --devices=cuda:0,cpu --replay_buffer_size=655360 --explicit_learning=true

GPU利用率高
./build/examples/alpha_zero_torch_example --game=new_game --actors=20 --inference_batch_size=6 --inference_threads=3 --evaluators=4 --inference_cache=2621440 --max_simulations=100 --path=./point --checkpoint_freq=10 --max_steps=100 --devices=cuda:0,cpu --replay_buffer_size=655360 --explicit_learning=true

查看GPU驱动
watch -n 1 nvidia-smi
watch -n 1 gpustat

安装gpu驱动
sudo apt purge '^nvidia-.*'
sudo apt purge '^cuda-.*'
sudo apt purge '^libcuda.*'
sudo apt autoremove
sudo apt clean
ubuntu-drivers devices
nvcc -V
export PATH=/usr/local/cuda-12.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

开启Cmake 调试日志
-DCMAKE_CXX_FLAGS="-fsanitize=address -g" \
-DCMAKE_CXX_FLAGS_DEBUG="-O0" \