-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker GPU Support? #102
Comments
Are you using the latest (v2 alpha) version of test runner? Could you also indicate which unity version you're using? |
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/checkout@v2.3.4
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v2.1.4
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
restore-keys: |
Library-${{ matrix.projectPath }}-
Library-
- uses: game-ci/unity-test-runner@v2.0-alpha-3
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 }} |
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. |
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. |
Currently no, but you could fork the action, change some things and try it out. If you manage to run it without Note that you may have to use the |
Gosh, I'm having the worst time trying to change the graphics card renderer with Unity. |
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. |
Did you end up trying without the |
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? |
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 If you're able to get the action to work without |
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! |
Related: #113 |
I'm trying to perform unit tests on GPU shaders and I've gone through setting up my docker (in my self-hosted runner) to use my nvidia GPU (RTX 2080) but I still keep getting errors to do with Compute Shaders in Unity not compiling through docker.
Is there some setting in the Unity Test Runner GitHub Action that could be overwriting this value?
The text was updated successfully, but these errors were encountered: