Taylor Petrick
tpetrick
About Me
Connect
LOCATION
Canada
ウェブサイト
Houdini Engine
Availability
Not Specified
Recent Forum Posts
Does the Python Virtual Environment TOPS Node Actually Work? 2024年9月3日9:41
Yes, the Virtual Environment node works. It's used internally by the ML Regression Train [www.sidefx.com] node that ships with H20.5, as well as the ML terrain [www.sidefx.com] example in the content library that works in both H20 and H20.5.
The virtual environment node creates an environment using Python's venv module -- it does not work with other venv solutions like Conda. It creates the appropriate directory on disk and installs a list of packages to the environment with pip.
It does not, however activate the environment or run any code in the environment. It's still up to you to actually use the venv for something, for example by configuring a Python Ssript TOP to execute in that environment. You can do that by setting the Python Script's Cook Type to Out of Process, and changing the Python Bin parameter to virtual environment. Tasks in the Python Script node will then run using the interpreter in the virtual environment.
The virtual environment cannot be used with in-process Python Script TOP tasks, or other nodes like the Python SOP or Python Snippet COP because all of those nodes run their code inside of Houdini. They can therefore only use the Python interepreter/packages that are emebedded inside of Houdini.
I've attached an example scene file. If you cook the Python Script node and inspect the log for the task in that node, you'll see a print-out showing that the imported module was from the venv's package path.
The virtual environment node creates an environment using Python's venv module -- it does not work with other venv solutions like Conda. It creates the appropriate directory on disk and installs a list of packages to the environment with pip.
It does not, however activate the environment or run any code in the environment. It's still up to you to actually use the venv for something, for example by configuring a Python Ssript TOP to execute in that environment. You can do that by setting the Python Script's Cook Type to Out of Process, and changing the Python Bin parameter to virtual environment. Tasks in the Python Script node will then run using the interpreter in the virtual environment.
The virtual environment cannot be used with in-process Python Script TOP tasks, or other nodes like the Python SOP or Python Snippet COP because all of those nodes run their code inside of Houdini. They can therefore only use the Python interepreter/packages that are emebedded inside of Houdini.
I've attached an example scene file. If you cook the Python Script node and inspect the log for the task in that node, you'll see a print-out showing that the imported module was from the venv's package path.
Karma XPU rendering and PDG 2024年8月6日9:47
You can change the render delegate from Karma CPU to Karma XPU on the USD Render Files node, on the Husk Options tab. Note that in H20.5 there were some changes on the karma/LOPs side of things:
Which means that you'll need to explicitly choose the render delegate in TOPs, even if your .usd file has a "engine" render setting.
Change the meaning of the "engine" render setting to only control the UI displayed in the Karma LOP. Users should select either the CPU or XPU delegate explicitly.
Which means that you'll need to explicitly choose the render delegate in TOPs, even if your .usd file has a "engine" render setting.
Pre Cook Sanity Check 2024年7月26日10:50
You can register a custom function that gets invoked each time a graph is cooked, and can return True/False to allow/reject the cook to continue based on the state of the graph: https://www.sidefx.com/docs/houdini/tops/pdg/TypeRegistry.html#registerPreflightHandler [www.sidefx.com]
The documentation for that function includes a reference to a page that describes how to write and install custom handlers. Typically they're placed in the PDG search path and loaded when Houdini starts.
The documentation for that function includes a reference to a page that describes how to write and install custom handlers. Typically they're placed in the PDG search path and loaded when Houdini starts.