edbeeching / godot_rl_agents

An Open Source package that allows video game creators, AI researchers and hobbyists the opportunity to learn complex behaviors for their Non Player Characters or agents
MIT License
942 stars 69 forks source link

Examples crash on Nvidia GPUs - Pytorch requires CUDA support #9

Closed mischkadb closed 2 years ago

mischkadb commented 2 years ago

After the default installation from requirements.txt the examples crash on my PC with a 3080 Ti.

Here's the relevant error:

(pid=14972) NVIDIA GeForce RTX 3080 Ti with CUDA capability sm_86 is not compatible with the current PyTorch installation.
(pid=14972) The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
(pid=14972) If you want to use the NVIDIA GeForce RTX 3080 Ti GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
[...]
ray.exceptions.RayActorError: The actor died because of an error raised in its creation task, ray::PPO.__init__() (pid=14972, ip=192.168.178.46)
[...]
ray.tune.error.TuneError: ('Trials did not complete', [PPO_godot_2d6ae_00000])

There is no compatible version of PyTorch 1.9.0 with CUDA 11.3 in pip, so I tested the latest stable version of PyTorch (1.11.0 as of date) and it worked like a charm.

The pip command in the activated virtual environment is:

pip3 install torch==1.11.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

according to the official PyTorch documentation. It will replace PyTorch 1.9.0, so there is no need to uninstall it beforehand.

The conda command should be (not tested by me):

conda install pytorch cudatoolkit=11.3 -c pytorch
edbeeching commented 2 years ago

The latest release should install cuda support out of the box. Please let me know if you have still having issues.