Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by R-Hacker · Nov 04, 2019 at 05:15 PM · rendererubuntuheadless

render images on headless ubuntu server

I am trying to render images via a Unity build on an Ubuntu ssh server without a graphical interface. In the player log file the render is always a null device. How do I get a renderer?

In windows 10 it works even in -batchmode it finds a renderer and save the "test_pic".

I am also trying to debug this issue with a Ubuntu virtual machine but in the log file it also says: " No supported renderers found, exiting". When I am using the -bachmode cammand line argument it saves an image but it is gray because there is no renderer.

Thank you for any help I am stuck on this problem for a while now...

If you need any further information please let me know.

I have the following script attached to the camera:

 public class test : MonoBehaviour
     {
         void Start()
         {
             StartCoroutine(CapturePNGasBytes());
         }
     
         private IEnumerator CapturePNGasBytes()
         {
             Camera currentCamera = GetComponent<Camera>();
             yield return new WaitForEndOfFrame();
     
             int width = new int();
             int height = new int();
             width = 256;
             height = 256;
             //create rendertexture, Texture2D and 
             RenderTexture rt = new RenderTexture(width, height, 24, RenderTextureFormat.ARGB32);
             Texture2D sceneTexture = new Texture2D(width, height, TextureFormat.RGB24, false);
             Rect rectangle = new Rect(0,0,width,height);
     
     
             currentCamera.targetTexture = rt;
             currentCamera.Render();
             RenderTexture.active = rt;
             sceneTexture.ReadPixels(rectangle,0,0);
             sceneTexture.Apply();
     
             //clean up
             currentCamera.targetTexture = null;
             RenderTexture.active = null;
     
             //save image
             byte[] bytesPNG = sceneTexture.EncodeToPNG();
             System.IO.File.WriteAllBytes("test_pic.PNG", bytesPNG);
         }    
 }

My PlayerLog file:

 Multi-casting "[IP] 129.206.117.192 [Port] 55137 [Flags] 3 [Guid] 3521465150 [EditorId] 3375015719 [Version] 1048832 [Id] LinuxPlayer(129.206.117.192) [Debug] 1 [PackageName] LinuxPlayer" to [225.0.0.222:54997]...
     Waiting for connection from host on [0.0.0.0:55137]...
     Remaining time:8s
     Remaining time:7s
     Remaining time:6s
     Remaining time:5s
     Remaining time:4s
     Remaining time:3s
     Remaining time:2s
     Remaining time:1s
     Remaining time:0s
     Timed out. Continuing without host connection.
     Started listening to [0.0.0.0:55137]
     Starting managed debugger on port 56150
     Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=0.0.0.0:56150
     Preloaded 'ScreenSelector.so'
     PlayerConnection already initialized - listening to [0.0.0.0:55137]
     Initialize engine version: 2019.2.10f1 (923acd2d43aa)
     [XR] Discovering subsystems at path /net/hcihome/storage/rhaecker/scratch/documents/newupload/testpic_Data/UnitySubsystems
     Forcing GfxDevice: Null
     GfxDevice: creating device client; threaded=0
     NullGfxDevice:
         Version:  NULL 1.0 [1.0]
         Renderer: Null Device
         Vendor:   Unity Technologies
     Begin MonoManager ReloadAssembly
     - Completed reload, in  0.341 seconds
     UnloadTime: 1.052370 ms
     Setting up 16 worker threads for Enlighten.
       Thread -> id: 7f8366fb2700 -> priority: 1 
       Thread -> id: 7f83667b1700 -> priority: 1 
       Thread -> id: 7f8365fb0700 -> priority: 1 
       Thread -> id: 7f83657af700 -> priority: 1 
       Thread -> id: 7f8364fae700 -> priority: 1 
       Thread -> id: 7f8343fff700 -> priority: 1 
       Thread -> id: 7f83437fe700 -> priority: 1 
       Thread -> id: 7f8342ffd700 -> priority: 1 
       Thread -> id: 7f83427fc700 -> priority: 1 
       Thread -> id: 7f8341ffb700 -> priority: 1 
       Thread -> id: 7f83417fa700 -> priority: 1 
       Thread -> id: 7f8340ff9700 -> priority: 1 
       Thread -> id: 7f8323fff700 -> priority: 1 
       Thread -> id: 7f83237fe700 -> priority: 1 
       Thread -> id: 7f8322ffd700 -> priority: 1 
       Thread -> id: 7f83227fc700 -> priority: 1 
     ##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1572882315208,"processId":7294,"allocatedMemory":5259,"memoryLabels":[{"Default":1584},{"NewDelete":109},{"Thread":-192},{"Manager":256},{"Audio":192},{"Physics":32},{"Serialization":40},{"Terrain":88},{"String":1886},{"DynamicArray":64},{"PoolAlloc":-88},{"VR":1288}]}
     Comment

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Nov 04, 2019 at 05:16 PM

This sounds like a similar issues as it was mentioned over here

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

119 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Render to 'RenderTexture' in 'Headless Mode' 0 Answers

Changing two different objects renderer colour 1 Answer

Camera can see an Object 1 Answer

Problem with open world games 3 Answers

List.Add component as Renderer, can't access? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges