Jump to content

How to switch to GPU or OpenCL for all the sims, cache and viewports.


Recommended Posts

Hi,

Please let me know if there is a simple setting in preference where we can enable or switch to GPU or OpenCL. I am not sure whether viewport uses GPU, I think it does and I would also like to know if we can directly switch a DOP node to use GPU for its calculations. Can Mantra and Arnold use GPU? 

Please let me know the specific settings. Thanks again.

Link to comment
Share on other sites

def set_opencl(parent_node, parm_value):
    for node in parent_node.allSubChildren():
        for p in node.parms():
            if p.name()=='opencl':
                try:
                    p.set(parm_value)
                except hou.PermissionError: #this handles the case that the parm is inside of a locked .otl
                    pass

hou.session.set_opencl(hou.node('/obj/dopnet1’), 1,)

if you put this function into the session module you can enable or disable opencl in a dopnet using the last line of code with either 1 or 0 as the last argument

Edited by jkunz07
  • Like 3
Link to comment
Share on other sites

On 1/21/2017 at 11:11 PM, jkunz07 said:

def set_opencl(parent_node, parm_value):
    for node in parent_node.allSubChildren():
        for p in node.parms():
            if p.name()=='opencl':
                try:
                    p.set(parm_value)
                except hou.PermissionError: #this handles the case that the parm is inside of a locked .otl
                    pass

hou.session.set_opencl(hou.node('/obj/dopnet1’), 1,)

if you put this function into the session module you can enable or disable opencl in a dopnet using the last line of code with either 1 or 0 as the last argument

wow, that's awesomee. Thanks alott

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...