Equim-chan / Mortal

🚀🀄️ A fast and strong AI for riichi mahjong, powered by Rust and deep reinforcement learning.
https://mortal.ekyu.moe
GNU Affero General Public License v3.0
929 stars 118 forks source link

one_vs_three.py: failed to kill akochan: Access is denied. (os error 5) #5

Closed hyskylord closed 2 years ago

hyskylord commented 2 years ago

Hi,

I am trying to test Mortal vs Akochan and I get the following error:

C:\Users\****\anaconda3\envs\Mortal\python.exe C:/Users/****/source/repos/Mortal/mortal/one_vs_three.py
--------------------------------------------------
# 0
2022-07-14 19:47:58,547     INFO one_vs_three.rs:140  seed: [10000, 10500) w/ 16962033399555274180, start 500 groups, 2000 hanchans
2022-07-14 19:48:16,421    ERROR   akochan.rs:77   failed to kill akochan: Access is denied. (os error 5)
Traceback (most recent call last):
  File "C:\Users\****\source\repos\Mortal\mortal\one_vs_three.py", line 86, in <module>
    main()
  File "C:\Users\****\source\repos\Mortal\mortal\one_vs_three.py", line 67, in main
    rankings = env.ako_vs_py(
RuntimeError: pipe is being closed. (os error 232)

I tried to run command line with admin previledge but the issue still persists.

Equim-chan commented 2 years ago

This error indicates you have an issue running akochan. You could try setting env OMP_NUM_THREADS=8, also make sure you have set the correct paths.

hyskylord commented 2 years ago

I tested akochan pipe on command line with some logs and it seems akochan is running normally. My config is posted below.

[1v3.akochan]
enabled = true
dir = 'C:/Users/****/source/repos/akochan'
tactics = 'C:/Users/****/source/repos/akochan/tactics.json'
Equim-chan commented 2 years ago

I can't reproduce the problem.

hyskylord commented 2 years ago

After some debugging I found that the broken pipe error occurs at the first line into akochan: writeln("start_game") as if the pipeline is never opened. I suspect this is related to certain OS settings.

2022-07-17 14:57:50,812     INFO one_vs_three.rs:140  seed: [10000, 10001) w/ 7718737994829340872, start 1 groups, 4 hanchans
2022-07-17 14:57:50,846     INFO   akochan.rs:168  Game Start: {"aka_flag":true,"kyoku_first":0,"type":"start_game"}
2022-07-17 14:57:50,846    ERROR   akochan.rs:83   failed to kill akochan: Access is denied. (os error 5)
hyskylord commented 2 years ago

The problem was fixed by itself. No idea what happened but probably an OS or antivirus issue.