Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running OpenSpiel in Windows #59

Closed
jamesdfrost opened this issue Sep 17, 2019 · 16 comments
Closed

Running OpenSpiel in Windows #59

jamesdfrost opened this issue Sep 17, 2019 · 16 comments
Labels
still opened for reference Partially supported feature, for discussion. Closed after no activity for a while.

Comments

@jamesdfrost
Copy link
Contributor

Have had a first stab at running OpenSpiel within the Windows Subsystem for Linux (WSL) version 1 on Windows 10, and its been partially successful - 54% of tests passed. Not suggesting this as a long term solution for Windows support, but may hep some in the short term.

First of all installed WSL as per the instructions here: https://docs.microsoft.com/en-us/windows/wsl/install-win10

The highest version of SUSE support was 18.04, so had to upgrade cmake via the following commands:

wget http://www.cmake.org/files/v3.12/cmake-3.12.4.tar.gz
tar -xvzf cmake-3.12.4.tar.gz
cd cmake-3.12.4/
./configure
make
sudo make install
sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force

After that, the install instructions seemed to work fine. Looks like the tests failing are the Python ones - anyone got any suggestions on resolving this?

54% tests passed, 43 tests failed out of 94

Total Test time (real) = 130.80 sec

The following tests FAILED:
49 - python_api_test (Failed)
50 - python_playthrough_test (Failed)
51 - python_action_value_vs_best_response_test (Failed)
52 - python_best_response_test (Failed)
53 - python_cfr_test (Failed)
54 - python_deep_cfr_test (Failed)
55 - python_dqn_test (Failed)
56 - python_eva_test (Failed)
57 - python_evaluate_bots_test (Failed)
58 - python_expected_game_score_test (Failed)
59 - python_exploitability_descent_test (Failed)
60 - python_exploitability_test (Failed)
61 - python_fictitious_play_test (Failed)
62 - python_generate_playthrough_test (Failed)
64 - python_rl_losses_test (Failed)
65 - python_lp_solver_test (Failed)
66 - python_mcts_test (Failed)
68 - python_nfsp_test (Failed)
69 - python_outcome_sampling_mccfr_test (Failed)
70 - python_policy_gradient_test (Failed)
71 - python_projected_replicator_dynamics_test (Failed)
72 - python_generalized_psro_test (Failed)
73 - python_rectified_nash_response_test (Failed)
74 - python_random_agent_test (Failed)
75 - python_rcfr_test (Failed)
76 - python_sequence_form_lp_test (Failed)
78 - python_bluechip_bridge_wrapper_test (Failed)
79 - python_uniform_random_test (Failed)
80 - python_alpharank_test (Failed)
81 - python_alpharank_visualizer_test (Failed)
82 - python_dynamics_test (Failed)
83 - python_heuristic_payoff_table_test (Failed)
84 - python_utils_test (Failed)
85 - python_visualization_test (Failed)
86 - python_catch_test (Failed)
87 - python_cliff_walking_test (Failed)
88 - python_data_test (Failed)
89 - python_bot_test (Failed)
90 - python_games_sim_test (Failed)
91 - python_matrix_game_utils_test (Failed)
92 - python_policy_test (Failed)
93 - python_pyspiel_test (Failed)
94 - python_rl_environment_test (Failed)
Errors while running CTest
jfadmin@QJF-SURFACEBOOK:~/open_spiel/build$

@elkhrt
Copy link
Member

elkhrt commented Sep 17, 2019 via email

@jamesdfrost
Copy link
Contributor Author

That's correct - I've followed the same process on a clean SUSE 18.04 Azure VM and all of these tests pass. Have also confirmed that Python is installed (3.6.8) and working within the WSL environment.

Suspect a missing dependency - any suggestions on troubleshooting this welcome.

@lanctot
Copy link
Collaborator

lanctot commented Sep 17, 2019

Nice.. consider me partly blown away!!

To build the python extensions you need python3-dev. It's possible that pyspiel (i.e. pybind11 that provides the python API) is failing to build without it. Or it could be that PYTHONPATH is not setup properly once it is.

Or it could be because you don't have pip3 and the python dependencies.

Could you try the manual Python instructions here, export the PYTHONPATH manually in the shell, and then run the python example via python3 python/examples/example --game=tic_tac_toe ?

@lanctot
Copy link
Collaborator

lanctot commented Sep 17, 2019

Another idea: can you run python3 and import pyspiel on the command-line?

@jamesdfrost
Copy link
Contributor Author

Thanks Lanctot - after following the first set of instructions you posted above, and with the Python environment activated: 100% tests passed, 0 tests failed out of 94

So it works under WSL with a bit of tweaking - the main disadvantage with this approach is this currently won't support CUDA for training.

Something doesn't quite make sense to me in what part of this fixed the issue, so I'm going to reset the environment and re-run through the process. Will update findings above.

@lanctot
Copy link
Collaborator

lanctot commented Sep 17, 2019

Wow, @jamesdfrost -- I'm very impressed! And WSL is quite a lot more than I thought.

Would you be willing to put together a windows.md markdown write-up that we can link from the main page that documents the steps?

Again: this is really amazing, thanks for extending the reach of OpenSpiel.

@lanctot
Copy link
Collaborator

lanctot commented Sep 17, 2019

So why no cuda, btw-- is WSL an emulator? Would it not use a CUDA-enabled Tensorflow through WSL?

@jamesdfrost
Copy link
Contributor Author

jamesdfrost commented Sep 17, 2019

Lanctot - happy to try and document this properly, do I do a pull request for that or just send you the .md file?

WSL is getting quite impressive these days. although this doesn't allow GPU passthrough. Linux Docker images running under Windows also suffer from the same limitation, so training larger networks really needs to either run natively in Windows or dual booting to Linux.

WSL2, which should be coming in the September update to Win10 will be based on Hyper-V and introduces a number of performance improvements, although GPU passthrough isn't going to be one of them initially. There have been a few hints that a range of "hardware improvements" will be coming in a future release.

Most of the DL experimenting I've done has been Windows based, where I can get TF / Cuda / Python working in a pure Microsoft environment under Anaconda, but I suspect getting OpenSpiel running in native Windows is going to be difficult.

@lanctot
Copy link
Collaborator

lanctot commented Sep 17, 2019

Yes, a PR would be great (you can put it in the docs directory, and we'll link it either from the main page or installation doc). That way others can take a look too, and we can comment on it if necessary.

Originally I thought it would be difficult to get native support as well, but you're turning me into a believer. The C++11 is failry simple (another benefit of the first "Keep it Simple" design philosophy!) so I am now thinking it might not actually be too hard to compile on Windows compilers.

I thought the biggest obstacle might be pybind11, but I just checked and it works under Visual Studio 2015 or newer. So I imagine it might be possible!

@jamesdfrost
Copy link
Contributor Author

Have an MD written, but on running through it I'm getting a fail with one test -
50 -python_playthrough_test (Failed)

I've run through the process twice and still get this. This test was definitely working yesterday, has something else changed that would cause this?

@lanctot
Copy link
Collaborator

lanctot commented Sep 18, 2019

@jamesdfrost, that was my fault -- apologies. If you pull and merge, that should be fixed.

@lanctot
Copy link
Collaborator

lanctot commented Sep 18, 2019

I take it back; might not have been my fault. :) But yes there were changes, but none should have affected you. Hmm, maybe still try a pull though, if you are on a branch could be why?

Or try with a fresh clone?

@jamesdfrost
Copy link
Contributor Author

Have re-run the whole process and all good now. I was starting to worry about the stability of WSL, but I think it's all good. Will try and do the PR tonight.

@DennisSoemers
Copy link
Contributor

DennisSoemers commented Sep 20, 2019

Most of the DL experimenting I've done has been Windows based, where I can get TF / Cuda / Python working in a pure Microsoft environment under Anaconda, but I suspect getting OpenSpiel running in native Windows is going to be difficult.

Actually a while ago I did get as far as you did in your initial comment here -- all C++ tests succeeding, all python tests failing -- in native Windows.

That did involve quite a bit more trickery already than your solution does though... including a couple of small changes in OpenSpiel's C++ code, and forcing Visual Studio to ignore an unresolved-external-symbol-error and continue building anyway. And then there was still the issue where python bindings didn't seem to work, and at that time I decided it was easier for me to just reboot to Linux than it was to try to figure out how to make that work.

But if you also got that last part to actually work... I guess I might give it another try again, with help from the above discussion, when I get bored some time.

@lanctot
Copy link
Collaborator

lanctot commented Sep 20, 2019

I have imported your doc, @jamesdfrost , should go in at the next update. I will leave this issue open because eventually it will be great if we have full/native support, and people can use it to coordinate efforts.

@jblespiau jblespiau added the still opened for reference Partially supported feature, for discussion. Closed after no activity for a while. label Oct 1, 2019
@lanctot
Copy link
Collaborator

lanctot commented Nov 12, 2019

Closing this as it's no longer an issue. We still want better Windows support, but people will be able to find it this thread and I'd like to keep the Issues open for actual issues.

@lanctot lanctot closed this as completed Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
still opened for reference Partially supported feature, for discussion. Closed after no activity for a while.
Projects
None yet
Development

No branches or pull requests

5 participants