latitudegames / AIDungeon

Infinite adventures await!
http://www.aidungeon.io/
MIT License
3.18k stars 555 forks source link

Add launch argument for using CPU instead of GPU #231

Closed Miffyli closed 4 years ago

Miffyli commented 4 years ago

๐ŸŽ‰ Issues resolved:

A simple argument which forces use of CPU instead of trying to load model to a GPU with possibly not enough memory.

This is especially useful on Windows where CUDA_VISIBLE_DEVICES environment variable does not work and you have GPU-enabled Tensorflow installed as it is for other purposes.

๐Ÿงช How to Test

  1. Have GPU-enabled Tensorflow installed
  2. Launch game with python play.py --cpu
  3. Game should now only load model to RAM and not touch GPU devices.

Other comments

Automatic detection is also an option. However this would become brittle if, in future, the model is squeezed into smaller size (which would then fit to e.g. 8GB GPU cards).

ben-bay commented 4 years ago

Thank you!