Announcement

Collapse
No announcement yet.

processor affinity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • processor affinity

    An option for vray not to use all available cores would be awesome. I would set it to -1 (all available cores -1) all the time as I invariably end up doing this in task manager anyway.

    thanks!
    www.peterguthrie.net
    www.peterguthrie.net/blog/
    www.pg-skies.net/

  • #2
    You can set the number of rendering threads from MaxScript like so:
    Code:
    renderers.current.system_numThreads=N
    Where N is the number of threads you want to use for rendering. We could perhaps add UI for this option, like we have in Maya. A disadvantage is that this is saved with the scene and may not be relevant if you try to render on another machine with a different number of cores. This option is ignored on render servers.

    You can also control this with an environment variable VRAY_NUM_THREADS=N - this is always enforced regardless of whether the machine is a render client or server).

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      thanks vlado will try it out. any way to set it to the number of threads available minus 1?
      www.peterguthrie.net
      www.peterguthrie.net/blog/
      www.pg-skies.net/

      Comment


      • #4
        Windows adds an environment variable NUMBER_OF_PROCESSORS which you can read and use (either from MaxScript, or from a batch file).

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment


        • #5
          You could have pre and post rendering scripts (Common tab in the Render Dialog) as such:

          Pre:
          Code:
          renderers.current.system_numThreads = systemTools.NumberOfProcessors() - 1
          Post:
          Code:
          renderers.current.system_numThreads = 0
          Or use this to set it manually:
          Code:
          --simple render thread setter for vray
          --mail at rensheeren.com
          
          try(destroyDialog rltMain)
          catch()
          
          rollout rltMain "Set Render Threads"
          (
          	fn  fnSetAll =
          	(
          		renderers.current.system_numThreads = 0
          	)
          	
          	fn  fnSetMinOne =
          	(
          		renderers.current.system_numThreads = systemTools.NumberOfProcessors() - 1
          	)
          	
          	fn  fnGetUsedThreads =
          	(
          		iThreads = renderers.current.system_numThreads
          	)
          	
          	button btnSetAll "Set to All"
          	button btnSetMinOne "Set to All-1"
          	editText edtThreads "Threads (0=All):" text:(fnGetUsedThreads() as string) readOnly:true
          	
          	on btnSetAll pressed do
          	(
          		fnSetAll()
          		edtThreads.text = fnGetUsedThreads() as string
          	)
          	
          	on btnSetMinOne pressed do
          	(
          		fnSetMinOne()
          		edtThreads.text = fnGetUsedThreads() as string
          	)
          )
          
          createDialog rltMain
          Rens Heeren
          Generalist
          WEBSITE - IMDB - LINKEDIN - OSL SHADERS

          Comment


          • #6
            Peter have you tried Processor Lasso? I used to use this some years back. You can set any application to any affinity and priority level and will automatically run with windows. Could be an option. No idea if it's still around and supported or not though. That said, these scripts above look very cool, especially if you could have it set it back to full threads after each render.
            Alex York
            Founder of Atelier York - Bespoke Architectural Visualisation
            www.atelieryork.co.uk

            Comment

            Working...
            X