Coder Social home page Coder Social logo

Docker GPU Support? about unity-test-runner HOT 13 OPEN

game-ci avatar game-ci commented on August 22, 2024 3
Docker GPU Support?

from unity-test-runner.

Comments (13)

Mannilie avatar Mannilie commented on August 22, 2024 2

After a heap of research into this, I've found that it must be related to the fact that the test runner is running as a headless editor. Hense, the Compute Shaders aren't being run.

Is there any way around this perhaps? I was going to test it without batchmode but I don't think you can change it in the GitHub Action.

from unity-test-runner.

webbertakken avatar webbertakken commented on August 22, 2024

Are you using the latest (v2 alpha) version of test runner?

Could you also indicate which unity version you're using?

from unity-test-runner.

Mannilie avatar Mannilie commented on August 22, 2024

Here's the latest version I am using.

Also note that I tried using custom parameters with: -force-opengl and --default-runtime=nvidia but I think I'm using it wrong :/

  
name: Build project
on:
  pull_request: {}
  push: { branches: [Release-DLL] }
env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
  
jobs:
  testAllModes:
    name: ${{ matrix.unityVersion }} ${{ matrix.testMode }} ${{ matrix.targetPlatform }}
    runs-on: self-hosted
    strategy:
      fail-fast: false
      matrix:
        projectPath:
          - ./
        unityVersion:
          - 2019.4.11f1
          #- 2020.2.0f1
        targetPlatform:
          #- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
          #- StandaloneWindows # Build a Windows standalone.
          #- StandaloneWindows64 # Build a Windows 64-bit standalone.
          - StandaloneLinux64 # Build a Linux 64-bit standalone.
        testMode:
          - playmode
          #- editmode
    steps:
      - uses: actions/[email protected]
        with:
          fetch-depth: 0
          lfs: true
      - uses: actions/[email protected]
        with:
          path: ${{ matrix.projectPath }}/Library
          key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
          restore-keys: |
            Library-${{ matrix.projectPath }}-
            Library-
      - uses: game-ci/[email protected]
        id: tests
        with:
          projectPath: ${{ matrix.projectPath }}
          unityVersion: ${{ matrix.unityVersion }}
          testMode: ${{ matrix.testMode }}
          artifactsPath: ${{ matrix.testMode }}-artifacts
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          checkName: true
          customParameters: -force-opengl
      - uses: actions/upload-artifact@v2
        with:
          name: Test results for ${{ matrix.testMode }}
          path: ${{ steps.tests.outputs.artifactsPath }}

from unity-test-runner.

webbertakken avatar webbertakken commented on August 22, 2024

Test runner will pass custom parameters directly into the editor.

You can use all the Unity command line parameters from the documentation (scroll down a bit to Options).

Note that you shouldn't pass arguments that the action already passes by default, as duplicate parameters will fail your build.

As for how to solve the problem; no idea. Hopefully someone else has any ideas.

from unity-test-runner.

webbertakken avatar webbertakken commented on August 22, 2024

Currently no, but you could fork the action, change some things and try it out. If you manage to run it without headless flag we could introduce a parameter that enables testing shaders.

Note that you may have to use the customImage flag as well and install additional packages to the editor image.

from unity-test-runner.

Mannilie avatar Mannilie commented on August 22, 2024

Hey just a quick question,
Is there anywhere in this repo that is forcing the renderer to be set to llvmpipe?
I'm trying to expose the NVIDIA driver to docker and I've tried everything. It works on other docker images just not "unityci/editor:...." ones.

image

from unity-test-runner.

Mannilie avatar Mannilie commented on August 22, 2024

Gosh, I'm having the worst time trying to change the graphics card renderer with Unity.
It says on the host machine that the NVIDIA graphics card is exposed to Docker... just Unity isn't using it at all... it keeps defaulting back to this renderer (llvmpipe)

from unity-test-runner.

Mannilie avatar Mannilie commented on August 22, 2024

Okay, I know this must be annoying but I made some headway with this issue and I'm writing this for anyone who experiences this issue.

I'm directing the issue over to Unity because it appears that Docker and everything else seems to be accepting the graphics card within the container but Unity is the only app that doesn't detect GPUs in the context of a 'virtual' environment.

from unity-test-runner.

webbertakken avatar webbertakken commented on August 22, 2024

Did you end up trying without the -batchmode flag (which is hardcoded in our images)?

from unity-test-runner.

Mannilie avatar Mannilie commented on August 22, 2024

I can confirm that -batchmode was the reason it wasn't picking up the GPU... is there a way that you can make a variable for that somewhere?

from unity-test-runner.

webbertakken avatar webbertakken commented on August 22, 2024

You can run the editor without the alias that we are providing, which will omit the flag. You could also extend the image and create your own alias.

Inside the action you can use the customImage parameter. To also change the command that the action issues, you could fork the action and change it.

If you're able to get the action to work without -batchmode, we're open to accept a PR both on docker and on this action (as well as on the builder action). The PR on docker will automatically be tested against all the latest unity versions.

from unity-test-runner.

Mannilie avatar Mannilie commented on August 22, 2024

Hey @webbertakken ,

It just occurred to me that I left this open. I actually managed to solve the issue!

It's such a damn setup though and I had to make my own fork to do it. I'll make a pull request with what I changed so you can see the settings I had to put in.

No custom image required.

Thanks for all your help!

from unity-test-runner.

webbertakken avatar webbertakken commented on August 22, 2024

Related: #113

from unity-test-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.