Search Unity

How to tell player to use specific device?

Discussion in 'Linux' started by btristan, Jul 16, 2019.

  1. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    95
    The docs show that there are Windows/Mac options for using a specific graphics device. How can I do the same with Linux?

    My use-case is running it in an Ubuntu Docker container which is exposing the host's Nvidia GPU. However, Unity is not detecting the Nvidia GPU automatically.
     
    Last edited: Jul 16, 2019
  2. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
    As far as I can tell only Metal on OSX has the command line switch for a graphics device. For the other platforms you have to make do with the tools made available by the platforms themselves.
     
  3. andrews_unity

    andrews_unity

    Unity Technologies

    Joined:
    Dec 11, 2015
    Posts:
    264
    So in 2019.3 we have added support for all platforms to be able to specify which GPU you can target, for Linux it would be Vulkan only support since on openGL there is not a clear way to make this happen without vendor specific ext or creating a X session for each window and then a context for each window etc... which is not something Unity supports.

    force-device-index would be the commandline for that.
     
  4. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    95
    Awesome, thanks!

    For anyone else who is looking in the mean-time: set the DISPLAY environment variable your GPU-accelerated display and Unity should be able to pick it up from there.