Announcement

Collapse
No announcement yet.

Maya Command Line rendering - Vray uses both GPU and CPU regardless of file render settings.

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

  • Maya Command Line rendering - Vray uses both GPU and CPU regardless of file render settings.

    I'm trying to render several different cameras in a scene using a command line render script on Mac OS. The scene has two render layers, #1 is set to use GPU only, #2 (an ambient occlusion pass) is set to use CPU only. When I run the script the render works, but it ignores the render settings and uses both GPU and CPU for layer #1. Since I've never had a benefit from hybrid rendering, is there a flag for command line rendering to tell Vray to only use GPU/CPU?



  • #2
    Hello there,

    Is it possible to send a scene with the set-up you are using, so I can have a further look into the problem?

    Kind Regards,
    Dimitrina Milanova

    Comment


    • #3
      Thanks for the response - The same thing happens with simple 1-layer scenes set to render only using GPU. I'm attaching one here, along with the batch script used. I should mention I tried adding a line to the Maya.env file ( "VRAY_GPU_PLATFORMS=geforce gtx titan x gpu index0" also tried just "VRAY_GPU_PLATFORMS=gpu" ) in case that was the issue, but it made no difference; the command line render still uses both GPU and CPU regardless of the Render Setting.
      Attached Files
      Last edited by chronopsis; 08-03-2021, 08:27 AM.

      Comment


      • #4
        Any more thoughts on this? I also tried rendering with Vray standalone using a similar bash script, designated -rtEngine=5 (GPU CUDA) as the renderer. Still uses both CPU and GPU.

        Comment


        • #5
          Hi,

          Setting the production renderer (where the choice is betwen CPU and CUDA) is different from setting the devices to use for CUDA.
          In theory, you can add a layer override for the renderer, as it's an actual attribute in Maya, although it's not recommended at all to mix CPU and GPU renders for the same project.

          The device selection for CUDA rendering, however, is just a way to display the selection for ease of use, but you can't add layer overrides from the UI to those.
          The actual selection that goes to V-Ray is the value of the VRAY_GPU_PLATFORMS environment variable. The device selection checkboxes in the UI are just a way to easily display and change the environment variable value(s).
          A side note - the value for VRAY_GPU_PLATFORMS is set per machine, not per scene. This means that whatever value is assigned on the machine is what will get used, no matter the scene.

          The best way to render with different devices per layer is by changing the value for VRAY_GPU_PLATFORMS for each layer. You can do this with a per-layer callback in the render settings (something like putenv "VRAY_GPU_PLATFORMS" "gtx") or by declaring a new value in the shell script for each layer. Here's an example:

          Code:
          export VRAY_GPU_PLATFORMS=gtx
          /Applications/Autodesk/maya2020/Maya.app/Contents/bin/Render -r vray -rl "layer1" commandLineRenderTest.mb
          
          export VRAY_GPU_PLATFORMS==c++;gtx
          /Applications/Autodesk/maya2020/Maya.app/Contents/bin/Render -r vray -rl "layer2" commandLineRenderTest.mb
          Hope that helps
          Alex Yolov
          Product Manager
          V-Ray for Maya, Chaos Player
          www.chaos.com

          Comment


          • #6
            Thanks for this, I just recalled yesterday that I could log in as root and change the "vray_gpu_device_select" to use GPU only. It looks like this solves it. When I batch render it uses the scene file settings for layers - one layer using CUDA(GPU only), the other using CPU.

            Comment

            Working...
            X