Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Targeting different GPU's with Barracuda inferencing

Discussion in 'Barracuda' started by pccross, Apr 19, 2021.

  1. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    Just starting to try out Barracuda, and I'm liking what I see so far.
    I noticed the iWorker interface allows targeting either CPU or GPU. My question is if I have multiple GPU's on a system (say a discrete vs. integrated GPU), and for some reason I wanted to target my inferencing on a different GPU than Unity was launched on, is it possible with Barracuda?

    Also, I have a inferencing model highly optimized for OpenVINO. Is my only option for running with Barracuda to convert that model to ONXX? I believe I will lose the model optimization in doing that.
     
  2. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    400
    If you make a build, you can use `-force-device-index` to specify a specific GPU. This may also work in the editor, but I haven't tested it.

    Re: file format - we only support ONNX or the native Barracuda (.NN) format, which is unpublished. You can try and write your own converter with the help of `ModelBuilder` in C#. Or you could try to work with the file format directly you can see how Netron does it (although I highly recommend staying away from this option because it can break when we change the format)
     
  3. geekyneuro

    geekyneuro

    Joined:
    Jun 20, 2020
    Posts:
    2
    -force-device-index doesnt work on linux. How to run a binary produced from Unity on a specific GPU please ?
     
  4. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146