Frequently Asked Questions ############################## Where can I find the core **Kit** config file? ================================ It is ``kit-core.json`` located close to the **Kit** executable. Can I debug python extensions and scripts? =============================================== Yes! Use **VS Code** for that. 1. Run **Kit**, open **Window/Extensions Manager**, find and enable ``omni.kit.debug.vscode`` extension. You can now see the window called **VS Code Link** which shows you the status of the debugger connection. 2. Run **VS Code** with *Python* extension installed. Open the **Kit** project folder with it. 3. **Kit** already has a proper `.vscode/launch.json` in the project. So select the **Debugger** tab in **VS Code**, select **Python: Attach** and press the **Start Debugging** button. 4. The status now should be changed to **Connected** in the **Kit** **VS Code Link** window. 5. Hit **Break** button in this window, it shows an example of using ``omni.kit.commands.execute("DebugBreak")`` command to break. You can debug your python code and add breakpoints. .. note:: Unortunately folder linked scripts are not properly recognized in this setup, so you must add your breakpoints in the real source files, which can be found under the ``_build`` folder. Can I use numpy/tensorflow/[my python package] with **Kit**? ================================================================ Yes. **Kit** comes with embedded python 3.6. You have 2 options here: 1. Switch **Kit** to use your python instead. 2. Make your package visible to **Kit** Using a different python install ------------------- Find ``kit-core.json`` file. It has the ``/plugins/carb.scripting-python.plugin/pythonHome`` key set to embedded python, change it to your python installation, for instance: .. code-block:: json { "pythonHome": "C:/Users/bob/AppData/Local/Programs/Python/Python36" } Now whatever is installed into this python ``site-packages`` folder will be available for import. Make package visible to **Kit** python ---------------------------------------- If you already has your package somewhere you just need to add it to python's ``sys.path``. You can do it in python explicitly or use ``/plugins/carb.scripting-python.plugin/pythonPath`` to set `PYTHONPATH `_ in config: ``omniverse-kit.config.json``. Can I use packages from pip? ---------------------------------------- There are currently 2 ways to install packages from pip: at build-time and at run-time. For run-time **Kit** has :mod:`omni.kit.pipapi` extension to do that. It will check if the package is not available and will try to pip install it and cache it. Enabling the :mod:`omni.kit.pipapi` extension will allow specification of pip dependencies by extensions loaded after it. Refer to :mod:`omni.kit.pipapi` doc. There is an example extension: ``omni.kit.example.pipapi``. It uses ``pip --target`` to install into separate folder which are specified in config by ``/exts/omni.kit.pipapi/envPath``. For build-time one can package any python module into any extension, including packages from pip. You can also package pip wheel and specify :mod:`omni.kit.pipapi` to use it. Our build scripts have a simple way to pip install anything into a specified folder. The ``deps/pip.toml`` config is used to specify what and where to install. Install it into your extension and package with it. Random failures when loading omni.usd ? ========================================== You can debug how USD loads it's plugins with the environment variable ``TF_DEBUG``. If you set ``TF_DEBUG=PLUG_INFO_SEARCH``, it will print out all the ``plugInfo.json`` files it finds. If you set ``TF_DEBUG=PLUG_REGISTRATION``, it will print out all the plugins it tries to register. Also setting ``TF_DEBUG=PLUG_LOAD`` can be useful, as it prints the plugins loaded. Kit mutes USD output by default. To unmute it, you need to set ``"/omni.kit.plugin/usdMuteDiagnosticMessage"`` to ``false``. How can I profile Kit-based applications? ========================================== Set the configuration setting ``/app/profilerBackend`` to either "cpu", "gpu" or "nvtx" for different profiling backends to enable profiling.