MaciejKozarzewski / AlphaGomoku

AlphaZero for the game of Gomoku.
GNU General Public License v3.0
23 stars 0 forks source link

Illegal device 'gpu' #7

Closed nguyencongminh090 closed 8 months ago

nguyencongminh090 commented 2 years ago

I trying to run AlphaGomoku with GPU and receive

static ml::Device ml::Device::fromString(const string&) : Illegal device 'gpu'

This is my config file:

{
  "version": "5.3.4",
  "protocol": "gomocup",
  "use_logging": true,
  "always_ponder": true,
  "swap2_openings_file": "swap2_openings.json",
  "networks": {
    "freestyle": "freestyle_10x128.bin",
    "standard": "standard_10x128.bin",
    "renju": "",
    "caro": ""
  },
  "use_symmetries": true,
  "search_threads": 1,
  "devices": [
    {
      "device": "gpu",
      "batch_size": 12,
      "omp_threads": 1
    }
  ],
  "search_options": {
    "max_batch_size": 12,
    "exploration_constant": 1.25,
    "expansion_prior_treshold": 0.0001,
    "max_children": 30,
    "noise_weight": 0,
    "vcf_solver_level": 2,
    "vcf_solver_max_positions": 1600,
    "style_factor": 2
  },
  "tree_options": {
    "initial_cache_size": 8192,
    "edge_bucket_size": 100000,
    "node_bucket_size": 10000
  }
}
nguyencongminh090 commented 2 years ago

I run AG on Google Colab, maybe AG didn't recognize the GPU.

MaciejKozarzewski commented 1 year ago

It should not be "gpu" but "cuda:0" or any other index if you have more than 1 GPU. Try using auto-tuning to find out if AG can see this GPU.

MaciejKozarzewski commented 8 months ago

Since my last comment, I've added a command line option '--list-devices' that you can use to see what kind of devices are recognized by AG and can be used. Also it prints the names of the devices (for example this "cuda:0") that have to be written in the config fle.