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 /
  • Help Room /
avatar image
1
Question by rajchinna · Feb 09, 2018 at 06:43 AM · renderingrendertexturefreezeupdate functionheadless

Capture Screenshot on Linux Headless Machine

I am trying to build a Unity application that can run on a cloud Linux server (Ubuntu 16.04) and that will be taking input from network application (my client) and generate shapes based on the client input (user interacts with client). Since the system on cloud I will not be having any Physical display attached to it. This machine has just integrated Intel GPU.

I am able to get the end to end flow working when I run the application with Physical display connected to the Ubuntu machine. however, when I try to run the application on batchmode or by attaching to a virtual frame buffer (Xvfb) display then the application just generates the first frame (I came to know this by adding log in the update method and also captured screenshot via RenderTexture from Camera).

But, I am unable to get the application running with Virtual Frame Buffer / BatchMode. The app runs fine with -nographics option but the images that screencapture gets are just gray (blank). So, that's not an ideal solution for my problem.

I tried to set the default frame rate rate for my application but that didn't help. I am not sure what causing the engine to stop right after the first update call. I did end up trying the following solutions. but, nothing helped .

https://answers.unity.com/questions/353653/can-a-unity-game-be-started-over-ssh.html https://towardsdatascience.com/how-to-run-unity-on-amazon-cloud-or-without-monitor-3c10ce022639

sudo Xvfb :10 -ac -screen 0 1024x768x24 &

DISPLAY=:10 ./MyGaem.x86_64 -> Not working. Just first update gets called.

DISPLAY=:10 ./MyGaem.x86_64 -batchmode -> Not working. Just first update gets called.

DISPLAY=:10 ./MyGaem.x86_64 -batchmode -nographics -> Gray images.

Note, I am using Integrated Intel GPU

I can provide the Player.log for both working & non-working cases if someone can help.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by RohitNutalapati · Oct 19, 2018 at 05:49 PM

Try modifying the prefs file. It's in the same location as your Player.log file. Set full screen to 0 and monitor value appropriately.. the application should run in window mode and capture a screenshot. I tested on AWS running ubuntu 16.04..

 <unity_prefs version_major="1" version_minor="1">
         <pref name="Screenmanager Is Fullscreen mode" type="int">0</pref>
         <pref name="Screenmanager Resolution Height" type="int">1024</pref>
         <pref name="Screenmanager Resolution Width" type="int">1280</pref>
         <pref name="UnitySelectMonitor" type="int">0</pref>
 ...
 </unity_prefs>

Also try disabling the resolution prompt in player settings!

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
avatar image
0

Answer by malmaud · Feb 09, 2018 at 08:32 PM

I'm experiencing the same issue.

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
avatar image
0

Answer by gshabanov · Jul 03, 2018 at 02:18 AM

I used this link text Works great for headless apps.

Also run your app like this ./appname.sh -batchmode -log or windows /yourexec.exe -batchmode -log (DO NOT use -nographics]

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

132 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 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

how simply writing text on texture 0 Answers

Count colored pixels of RenderTexture and get this data on CPU. 0 Answers

Render Texture from Cameras targetTexture produces seams. 1 Answer

Is it possible to render only specific texture (albedo for instance) 0 Answers

Read Pixels to Texture2D in EditorWindow make unity crash 2 Answers


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