Search Unity

Question Installation For GPU

Discussion in 'ML-Agents' started by atmuc, Jan 13, 2023.

  1. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,166
  2. JustnTrying

    JustnTrying

    Joined:
    Sep 24, 2021
    Posts:
    7
    You can find installation instructions here:
    https://github.com/Unity-Technologies/ml-agents/blob/develop/docs/Installation.md
    However, they are slightly outdated, so I'll try to summarize for you:

    Officially, ml-agents supports Python3.10, however, due to some issues in the installation scripts, if you do not want to fix them by yourself, it's currently best to go with Python 3.9. You also need pytorch, you can take the most current version.
    For this, follow the instructions on https://pytorch.org/get-started/locally/ , if you want to use your GPU, it's important to follow the instructions given on the pytorch website. You will also need to install all CUDA dependencies if you haven't already: https://developer.nvidia.com/cuda-zone
    Hope this helps!
     
    Claytonious likes this.
  3. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    191
    mlagents uses pytorch. Here are the requirements specified in the mlagents python package requirements.txt file:

    Code (csharp):
    1.  
    2.         "torch>=1.8.0,<=1.11.0;(platform_system!='Windows' and python_version>='3.9')",
    3.         "torch>=1.6.0,<1.9.0;(platform_system!='Windows' and python_version<'3.9')",
    4.  
    In other words:
    - if your python is at least version 3.9, then torch will be between 1.8 and 1.11
    - if your python is less than 3.9 (eg 3.8), then torch will between 1.6 and 1.8