Table of Contents:
OpenMined Unity Application applies the PySyft library into a Unity Application. Please see the PySyft repository README.md for more details on the intent of OpenMined and to familiarize yourself more with the basic concepts of the project.
Also check out the Docs for more information! We are working toward consolidating all the documentation to make it easier for new contributors.
Why Unity?
Unity has a few advantages that we are leveraging for this project
- It's portable.
- It's free
- It has versitile GPU access.
- It can be used for high end graphics gaming consoles (Playstation, XBox, etc)
More about this in the corresponding file at tutorials folder
Marketplace Mechanics
TODO
If you have an issue, refer to the following steps for a more detailed project setup. These steps were confirmed to work under a Windows/linux environment, though the steps should be applicable to alternative operating systems.
The steps come in two parts:
Part 1: Unity Setup
Part 2: Jupyter Setup
Unity Setup
-
Download Unity from
-
Windows: https://store.unity.com/
-
OSX: https://store.unity.com/ Turn on Metal Support
NOTE: Unity does not provide metal support for MacOS 10.12.2 and 10.12.3. Please upgrade your OS before using Unity. -
Within Unity editor select:
Edit -> Project Settings -> Player
- In the Inspector, scroll down until you find
Metal Editor Support
underOther Settings
and click the checkbox to turn it on. (skip this if not on Mac OSX) - In the Inspector, expand
Resolution
and check the box forRun in Background
- In the Inspector, scroll down until you find
-
Linux: http://beta.unity3d.com/download/ee86734cf592/public_download.html
-
-
Open project in Unity
[Open(Top Right of Home Screen) -> Directory/To/OpenMined -> /UnityProject]
-
In the Project Pane (usually below), double click OpenMinedMain. If you can't find the file for some reason, check the trouble shooting section.
-
Hit
Play
on the Unity Editor
Jupyter Setup
- Run
jupyter notebook
from your OpenMined directory - Open Syft Tensor Example Notebook.ipynb
- Run the notebook
- If OpenMinedMain is missing
- On the right menu: Check
Main Camera
object hasSyftServer.cs
component attached to it - On the bottom dialog: Go to
OpenMined/Network/Servers
dragSyftServer.cs
toMain Camera
object - Add a
Compute Shader
to theShader
variable ofSyftServer.cs
script - Go to
OpenMined/Syft/Math/Shaders
dragFloatTensorShaders
toSyftServer (Script)
component recently attached toMain Camera
- If my applications do not seem to be communicating between eachother...
Check if the Server is running...
It should run on port 5555 and this can be checked by running the following command on CMD with administrator permissions.
netstat -a -b | findstr :5555
If just the Server is running, the output should be:
TCP 0.0.0.0:5555 YOUR_PC_NAME:0 LISTENING
If both Server and Jupyter Notebook are running and communicating, the output should be:
TCP 0.0.0.0:5555 YOUR_PC_NAME:0 LISTENING
TCP 127.0.0.1:5555 YOUR_PC_NAME:63956 ESTABLISHED
TCP 127.0.0.1:63956 YOUR_PC_NAME:5555 ESTABLISHED
Another way:
Osx/Linux
lsof -i :5555
Result should be:
Unity 1709 user 38u IPv4 0x59e297c6d0d734e31 0t0 TCP *:personal-agent (LISTEN)
- My application randomly stops working.
Jupyter Notebook only works if Unity has focus
By default, the "Run in background" options is disabled. So if the Unity Editor loses focus then the Jupyter Notebook won't work.
Go to Edit -> Project Settings -> Player. The inspector pane will now change to show the player settings. Look for the option that says "Run In Background" and check it [1]
How to add a Function to Float Tensor