SVG Importer white boxes when -nographics is specified on a CI server
Hi,
We are using Jenkins on a Mac (10.15) to build our Unity projects, and when we run a build from the following command-line on a fresh clone:
-nographics -batchmode -quit -executeMethod JenkinsBuild.BuildIOSDev
all of our SVG Icons are imported as white squares. We are using the Vector Graphics package 2.0.0 preview 12.
When we either launch the Unity Editor to import a freshly cloned project, or drop the -nographics as in the following, our SVG Icons import fine.
-batchmode -quit -executeMethod JenkinsBuild.BuildIOSDev
Is it a requirement for SVG Importing that we run our command-line builds with a graphics context (without -nographics)?
Thanks.
Ran into the exact same issue with a different version of the Vector Graphics package on Windows. It doesn't seem to be documented anywhere, but I'm wondering the same thing. However seeing as the Unity docs state the nographics option is needed to prevent a WindowServer error when activating, I'm praying removing this option doesn't break something else when Unity next decides to reactivate.
Answer by denravonska · Oct 21, 2021 at 02:57 PM
The fact that there is no indication in the build log that this is the case should be considered a bug in my opinion. Seeing
Importing myasset.svg: WARNING: No GPU detected, asset will be incomplete
in the log would have saved me a week of troubleshooting, trying to understand why it worked locally but not in the pipeline in Docker.
Answer by kahyong_unity · Jan 27, 2021 at 01:33 AM
Certain textures don't import properly because they require a GPU for the texture generation + multisampling. The -nographics option does not initialize the graphics device, which means there isn't a GPU available under that mode. So yes, it is a requirement.
Answer by MichaelJHart · Mar 23 at 05:07 PM
I realize this is a pretty old question, but this issue was fixed for me by upgrading to Vector Graphics package version 2.0.0-preview.18.
It looked like the issue only occurred for me when I used a Unity Image component that had the maskable flag on and an SVG as its sprite.