Iray fails to use CUDA devices on macOS
I've submitted a bug report for this, but I'm reposting here so that others can benefit from knowing it's out there and my workaround. I gather from forum discussion this is Mac-specific; I don't own a Windows machine to test with.
The Bug
When attempting to render a scene containing Iray shaders with texture maps in the Glossy Roughness, Transmitted Color, or Top Coat Roughness channels, the renderer logs an error and loses the ability to render using CUDA. It fails down to CPU rendering.
CUDA driver version 7.5.30, NVIDIA web driver 346.03.15f02 on OS X 10.11.6, with DAZ Studio 4.9.2.70 Pro Edition (64bit)
2016-00-06 21:00:36.641 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.7 IRAY rend error: Kernel [0] failed after 0.000s
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.7 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while launching CUDA renderer in core_renderer_wf.cpp:821)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.7 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): Failed to launch renderer
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): Device failed while rendering
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while initializing memory buffer)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: All workers failed: aborting render
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.642 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.6 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray WARNING - module:category(IRAY:RENDER): 1.6 IRAY rend warn : All available GPUs failed.
2016-00-06 21:00:36.643 Iray INFO - module:category(IRAY:RENDER): 1.6 IRAY rend info : Falling back to CPU rendering.
2016-00-06 21:00:36.643 Iray INFO - module:category(IRAY:RENDER): 1.0 IRAY rend info : Retry rendering with other devices.
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.0 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 WARNING: /src/pluginsource/DzIrayRender/dzneuraymgr.cpp(261): Iray ERROR - module:category(IRAY:RENDER): 1.0 IRAY rend error: CUDA device 0 (GeForce GTX TITAN X): an illegal instruction was encountered (while de-allocating memory)
2016-00-06 21:00:36.643 Iray INFO - module:category(IRAY:RENDER): 1.0 IRAY rend info : CPU: using 8 cores for rendering
2016-00-06 21:00:36.643 Iray INFO - module:category(IRAY:RENDER): 1.0 IRAY rend info : Rendering with 1 device(s):
2016-00-06 21:00:36.643 Iray INFO - module:category(IRAY:RENDER): 1.0 IRAY rend info : CPU
2016-00-06 21:00:36.643 Iray INFO - module:category(IRAY:RENDER): 1.0 IRAY rend info : Rendering...
The Workaround
This is a script I wrote to automatically remove those textures (very useful for large scenes; the Library is one of my favorite sets and suffers from it).
// DAZ Studio version 3.1 filetype DAZ Script //=================================================================== // Copyright (c) <2016> Jack of Spades // Permission is hereby granted, free of charge, to any persoration // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. var appName = "josOSXMatFix"; searchMats(); // Loop through materials and identify function searchMats( ) { var nodes = Scene.getNodeList(); var n = nodes.length; startProgress( "Fixing materials for Iray on macOS", n, true, true ); for( var i = 0; i < n; i++ ) { var node = nodes[i]; var obj = node.getObject(); if( obj ) { var nShapes = obj.getNumShapes(); for( var j = 0; j < nShapes; j++ ) { var shape = obj.getShape( j ); var nMats = shape.getNumMaterials(); for( k = 0; k < nMats; k++ ) { var mat = shape.getMaterial( k ); fixMat( node, mat ); } } } stepProgress( 1 ); } } // Remove problem properties function fixMat( node, mat ) { // We only know how to consume Iray Uber materials var shader = mat.getMaterialName(); if ( shader != 'Iray Uber' && shader != 'V3D_IRayTannedWetSkins' ) { print( "No Iray for " + node.name + " " + mat.name + "; shader '" + shader + "'" ); return; } removeMap( node, mat, "Glossy Roughness" ); removeMap( node, mat, "Transmitted Color" ); removeMap( node, mat, "Top Coat Roughness" ); } // remove map function removeMap( node, mat, prop ) { var propVal = mat.findProperty( prop ); if ( propVal ) { var mapValue = propVal.getMapValue(); if ( mapValue ) { propVal.setMap( "" ); print( mat.name + ": removed " + prop + " map." ); } } else { print("- no " + prop ); } }
Comments
I've seen this in some cases. Usually turning off Optix acceleration seems to fix it.
Turning off Optix doesn't seem to affect things for me. OptiX was off for the above error.
Thanks for putting together this script! This is very useful for me! :-)