Skip to content
Wai Wang edited this page Oct 28, 2024 · 11 revisions

WAI2K uses a variety of neural networks which can be accelerated through GPU.

With GPU acceleration, the inference time for the main map detection model can be brought down anywhere from 4000-10000 ms to down to 300 ms on average. This shaves on time each sortie, boosting your SPH and script responsiveness.

Currently GPU acceleration is only available on systems with Nvidia graphics cards, this is a library (Pytorch) limitation.

Pre-requisites:

Installing CUDA

  1. Download and run the Nvidia CUDA installer
  2. Choose the Custom installation option
  3. De-select all options except for CUDA>Runtime option
  4. Install

Setting up Environment Variables (Windows only)

If you don't know how to edit environment variables, go look it up, plenty of articles out there

  1. Search "Environment" or find it in Control Panel -> System -> Advanced system settings

  2. "Environment Variables..." button bottom right

  3. Double click "Path" in System variables not User Variables

System Variables- Path

  1. Append to the Path variable at the beginning/top:

    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\

Add Path Variable

Make sure to click OK, you may need to reboot for path variables to apply.

Screenshots maybe out of date, follow the steps!

You may run into issues with CUDA detection if there's a path variable referencing Nvidia PhysX, so you might want to remove that one if GPU acceleration doesn't work.

If still not working remember to check if your driver version is recent enough
Look for it in Add or Remove Programs -> NVIDIA Graphics Driver


If all is working well, WAI2K will show one or some other non-zero number in the debug console when it launches.

[WAI2K] [2020-10-10 13:28:56.084] [c.w.w.v.LoaderView] INFO - Loading detection model...
[WAI2K] [2020-10-10 13:28:56.134] [a.d.p.j.LibUtils] DEBUG - Using cache dir: /home/waicool20/.djl.ai/pytorch
[WAI2K] [2020-10-10 13:28:56.137] [a.d.p.j.LibUtils] DEBUG - Loading pytorch library from: /home/waicool20/.djl.ai/pytorch/1.7.0-cu110-linux-x86_64/0.9.0-SNAPSHOT-cu110-libdjl_torch.so
[WAI2K] [2020-10-10 13:28:56.397] [a.d.p.e.PtEngine] INFO - Number of inter-op threads is 6
[WAI2K] [2020-10-10 13:28:56.398] [a.d.p.e.PtEngine] INFO - Number of intra-op threads is 8
[WAI2K] [2020-10-10 13:28:56.398] [a.d.e.Engine] DEBUG - Engine loaded from provider: PyTorch
[WAI2K] [2020-10-10 13:28:56.399] [a.d.e.Engine] DEBUG - Found default engine: PyTorch
[WAI2K] [2020-10-10 13:28:56.400] [c.w.w.v.LoaderView] INFO - Detected GPUs: 1
[WAI2K] [2020-10-10 13:28:56.411] [c.w.w.v.LoaderView] INFO - Loading all done! Starting main application

As always, you're welcome to join our discord to ask for help!