Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How to force training (release 21) on the GPU?

Discussion in 'ML-Agents' started by romanuast, Mar 12, 2024.

  1. romanuast


    Dec 10, 2023
    Hi all!
    Question: How to force training (release 21) on the GPU?
    I'm working on Windows 10 in Unity 2022.3.15f1
    The command had no effect GPU is not involved in training
    ...\ml-agents21>mlagents-learn ...\config.yaml --run-id=name --torch-device cuda:0

    There is a graphics card NVIDIA GeForce RTX 4090, all drivers are installed (output below)
    (mlagents21) ...\ml-agents21>python -c "import torch; print(torch.cuda.is_available())"
    (mlagents21) ...\ml-agents21>nvcc --version
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2022 NVIDIA Corporation
    Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022
    Cuda compilation tools, release 11.8, V11.8.89
    Build cuda_11.8.r11.8/compiler.31833905_0

    (mlagents21) ...\ml-agents21>conda list cudatoolkit
    # packages in environment at ...\anaconda3\envs\mlagents21:
    # Name Version Build Channel

    (mlagents21) ...\ml-agents21>nvidia-smi
    Sun Mar 10 18:51:28 2024
    NVIDIA-SMI 551.61 Driver Version: 551.61 CUDA Version: 12.4