Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mayabatch.exe - application error #1310

Closed
robina80 opened this issue Jul 31, 2023 · 35 comments · Fixed by #1341
Closed

mayabatch.exe - application error #1310

robina80 opened this issue Jul 31, 2023 · 35 comments · Fixed by #1341
Labels
bug Something isn't working

Comments

@robina80
Copy link

robina80 commented Jul 31, 2023

hi all,

when i submit a maya job via cuesubmit and then look at the job in cuegui its "running" but all the time i get this pop up error and its always reappearing and it doesnt complete the job

mayabatch_error

heres the log it shows in cuegui

`===========================================================
RenderQ JobSpec Sun Jul 30 12:20:29 2023

proxy rqd.rqnetwork.RunningFrame/149a685e-997f-4485-bed8-2b08a3dd8156 -t:tcp -h 10.110.110.200 -p 10021
command Render -r file -s 1 -e 1 C:\Users\gfx14_uk\Desktop\test\TEST.ma
uid 1
gid 20
logDestination /home/opencue/opencue-demo/logs/testing/370/logs/testing-370-gfx14_uk_370--770e5193-cc00-4792-bd22-4fb7e292982a\testing-370-gfx14_uk_370.0001-370.rqlog
cwd C:\Users\gfx14_uk\AppData\Local\Temp/testing-370-gfx14_uk_370\0001-370
renderHost 10.110.110.200
jobId 770e5193-cc00-4792-bd22-4fb7e292982a
frameId 149a685e-997f-4485-bed8-2b08a3dd8156
env APPDATA=C:\Users\gfx14_uk\AppData\Roaming
env COMMONPROGRAMFILES=C:\Program Files\Common Files
env CUE3=1
env CUE_CHUNK=1
env CUE_FRAME=0001-370
env CUE_FRAME_ID=149a685e-997f-4485-bed8-2b08a3dd8156
env CUE_GPUS=0
env CUE_GPU_MEMORY=0
env CUE_IFRAME=1
env CUE_JOB=testing-370-gfx14_uk_370
env CUE_JOB_ID=770e5193-cc00-4792-bd22-4fb7e292982a
env CUE_LAYER=370
env CUE_LAYER_ID=22175045-83c4-4999-aea2-95eeac1a98ff
env CUE_LOG_PATH=/home/opencue/opencue-demo/logs/testing/370/logs/testing-370-gfx14_uk_370--770e5193-cc00-4792-bd22-4fb7e292982a
env CUE_MEMORY=3355443
env CUE_RANGE=1-100
env CUE_SHOT=370
env CUE_SHOW=testing
env CUE_THREADABLE=0
env CUE_THREADS=1
env CUE_USER=gfx14_uk
env LOGNAME=gfx14_uk
env PATH=C:\OpenCue\venv\Scripts;C:\Program Files\Python310\Scripts;C:\Program Files\Python310;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files\Python311\Scripts;C:\Program Files\Python311;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files\Eclipse Adoptium\jre-8.0.372.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jre-17.0.7.7-hotspot\bin;C:\Program Files\Eclipse Adoptium\jre-11.0.19.7-hotspot\bin;C:\Program Files (x86)\Eclipse Adoptium\jre-8.0.362.9-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\PuTTY;C:\Program Files (x86)\dotnet;C:\Program Files\dotnet;C:\Windows\gpfs_cygwin\usr\lpp\mmfs\win;C:\Program Files\Mellanox\MLNX_WinOF2\Management Tools;C:\Program Files\Mellanox\MLNX_WinOF2\Performance Tools;C:\Program Files\Mellanox\MLNX_WinOF2\Diagnostic Tools;C:\Program Files (x86)\Extensis\Universal Type Client;C:\Program Files\WireGuard;C:\Program Files\Autodesk\Maya2024\bin;C:\Program Files\Autodesk\Arnold\maya2024\bin;C:\Users\gfx14_uk\AppData\Local\Microsoft\WindowsApps;
env SP_NOMYCSHRC=1
env SYSTEMROOT=C:\Windows
env TERM=unknown
env TMP=C:\Users\gfx14_uk\AppData\Local\Temp
env TZ=PST8PDT
env USER=gfx14_uk
env frame=0001-370
env jobhost=10.110.110.200
env jobid=testing-370-gfx14_uk_370
env logfile=testing-370-gfx14_uk_370.0001-370.rqlog
env maxframetime=0
env mcp=1
env minspace=200
env shot=370
env show=testing
env zframe=0001-370

C:\OpenCue\venv\Scripts>Render -r file -s 1 -e 1 C:\Users\gfx14_uk\Desktop\test\TEST.ma

Starting "C:\Program Files\Autodesk\Maya2024\bin\mayabatch.exe"
`
and when i try to run the render command manually via cmd, i get this

`Render -r file -s 1 -e 1 C:\Users\gfx14_uk\Desktop\test\TEST.ma

Starting "C:\Program Files\Autodesk\Maya2024\bin\mayabatch.exe"
This plugin does not support createPlatformOpenGLContext!
Initialized VP2.0 renderer {
Version : 2016.11.62.12. Feature Level 5.
Adapter : NVIDIA RTX A4500/PCIe/SSE2
Vendor ID: 4318. Device ID : 8754
Driver : C:\Windows\System32\DriverStore\FileRepository\nv_dispwi.inf_amd64_de2577632fa3c946\nvoglv64.dll.dll:31.0.15.2895.
API : OpenGL V.4.6.
Max texture size : 16384 * 16384.
Max texture coords : 32
Shader versions supported (Vertex: 5, Geometry: 5, Pixel 5).
Shader compiler profile : (Best card profile)
Active stereo support available : 0
GPU Memory Limit : 20470 MB.
CPU Memory Limit : 124272 MB.
MultiDraw consolidation : enabled
}
OpenCL evaluator is attempting to initialize OpenCL.
Detected 1 OpenCL Platforms:
0: NVIDIA Corporation. NVIDIA CUDA. OpenCL 3.0 CUDA 12.0.151.
Supported extensions: cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_khr_gl_event cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_nv_kernel_attribute cl_khr_device_uuid cl_khr_pci_bus_info cl_khr_external_semaphore cl_khr_external_memory cl_khr_external_semaphore_win32 cl_khr_external_memory_win32
Selected matching OpenCL Platform: NVIDIA Corporation NVIDIA CUDA OpenCL 3.0 CUDA 12.0.151.
OpenCL evaluator choosing OpenCL platform NVIDIA Corporation.
OpenCL evaluator is unable to find a GPU device that can share VBOs with OpenGL.
00:00:01 1552MB | log started Sun Jul 30 12:09:58 2023
00:00:01 1552MB | Arnold 7.2.0.0 [3560d69f] windows x86_64 clang-10.0.1 oiio-2.4.1 osl-1.12.0 vdb-7.1.1 adlsdk-7.4.2.47 clmhub-3.1.1.43 rlm-14.2.5 optix-6.6.0 2023/02/06 16:46:20
00:00:01 1552MB | running on lon-p-gfx14, pid=7040
00:00:01 1552MB | 1 x 13th Gen Intel(R) Core(TM) i9-13900K (32 cores, 32 logical) with 130812MB
00:00:01 1552MB | NVIDIA driver version 528.95 (Optix 60805)
00:00:01 1552MB | GPU 0: NVIDIA RTX A4500 @ 1650MHz (compute 8.6) with 20469MB (19270MB available) (NVLink:0)
00:00:01 1552MB | Windows 10 (version 10.0, build 19045)
00:00:01 1552MB | soft limit for open files changed from 512 to 2048
00:00:01 1552MB |
00:00:01 1552MB | [metadata] loading metadata file: C:\Program Files\Autodesk\Arnold\maya2024\bin\arnold.mtd
00:00:01 1555MB | [color_manager_ocio] default ocio.config found in C:\Program Files\Autodesk\Arnold\maya2024\bin../ocio/configs/arnold/config.ocio
00:00:01 1555MB | loading plugins from C:\Program Files\Autodesk\Arnold\maya2024\bin..\plugins ...
00:00:01 1555MB | alembic_proc.dll: alembic uses Arnold 7.2.0.0
00:00:01 1556MB | cryptomatte.dll: cryptomatte uses Arnold 7.2.0.0
00:00:01 1556MB | cryptomatte.dll: cryptomatte_filter uses Arnold 7.2.0.0
00:00:01 1556MB | cryptomatte.dll: cryptomatte_manifest_driver uses Arnold 7.2.0.0
00:00:01 1556MB | [metadata] loading metadata file: C:\Program Files\Autodesk\Arnold\maya2024\bin..\plugins\cryptomatte.mtd
00:00:01 1596MB | usd_proc.dll: usd uses Arnold 7.2.0.0
00:00:01 1597MB | loaded 5 plugins from 3 lib(s) in 0:00.07
###############################################################################
Begin attempted read of a shade fragment XML file.
Attempting to read fragment XML code from: aiRectangleAreaLight.xml
Errors loading XML:

Could not find file: aiRectangleAreaLight.xml

End attempted read of fragment XML.
###############################################################################
qt.svg: Cannot open file ':/expression.svg', because: No such file or directory
qt.svg: Cannot open file ':/expression.svg', because: No such file or directory
File read in 0.015 seconds.
Result: C:/Users/gfx14_uk/Desktop/test/TEST.ma
Exporting Arnold Scene...
Updating Arnold Scene...
00:00:05 1688MB | log started Sun Jul 30 12:10:03 2023
00:00:05 1688MB | Arnold 7.2.0.0 [3560d69f] windows x86_64 clang-10.0.1 oiio-2.4.1 osl-1.12.0 vdb-7.1.1 adlsdk-7.4.2.47 clmhub-3.1.1.43 rlm-14.2.5 optix-6.6.0 2023/02/06 16:46:20
00:00:05 1688MB | host application: MtoA 5.3.0 467bd77f (fix-5.3.0) Maya 2024
00:00:05 1688MB | running on lon-p-gfx14, pid=7040
00:00:05 1688MB | 1 x 13th Gen Intel(R) Core(TM) i9-13900K (32 cores, 32 logical) with 130812MB
00:00:05 1688MB | NVIDIA driver version 528.95 (Optix 60805)
00:00:05 1688MB | GPU 0: NVIDIA RTX A4500 @ 1650MHz (compute 8.6) with 20469MB (19270MB available) (NVLink:0)
00:00:05 1688MB | Windows 10 (version 10.0, build 19045)
00:00:05 1688MB | soft limit for open files is set at 2048
00:00:05 1688MB |
Warning: WARNING | rendering with watermarks because of failed authorization:
00:00:14 1693MB WARNING | rendering with watermarks because of failed authorization:
00:00:14 1693MB | [rlm] error initializing license system:
00:00:14 1693MB | [rlm] * Can't read license data (-102)No such file or directory (errno: 2)
00:00:14 1693MB | [clm.v1] license server was not set (51)
00:00:14 1693MB | [clm.v2] SERVICE (13): entitlement not found
00:00:14 1693MB | environment variables:
00:00:14 1693MB | ARNOLD_LICENSE_ORDER = (not set)
00:00:14 1693MB | ARNOLD_LICENSE_MANAGER = (not set)
00:00:14 1693MB | [rlm] solidangle_LICENSE = (not set)
00:00:14 1693MB | [rlm] RLM_LICENSE = (not set)
00:00:14 1693MB | [clm] ADSKFLEX_LICENSE_FILE = (not set)
00:00:14 1693MB | [clm] LM_LICENSE_FILE = (not set)
Scene C:\Users\gfx14_uk\Desktop\test\TEST.ma completed.
00:00:17 1743MB | unloading 11 plugins
00:00:17 1743MB | closing alembic_proc.dll ...
00:00:17 1743MB | closing cryptomatte.dll ...
00:00:17 1742MB | closing usd_proc.dll ...
00:00:17 1738MB | closing hairPhysicalShader_shaders.dll ...
00:00:17 1738MB | closing lookdevkit_shaders.dll ...
00:00:17 1738MB | closing mtoa_shaders.dll ...
00:00:17 1738MB | closing renderSetup_shaders.dll ...
00:00:17 1738MB | closing xgenSpline_shaders.dll ...
00:00:17 1738MB | closing xgenSpline_procedural.dll ...
00:00:17 1738MB | closing xgen_procedural.dll ...
00:00:17 1738MB | closing arnold_bifrost.dll ...
00:00:17 1738MB | unloading plugins done
00:00:17 1738MB | Arnold shutdown`

so looks like opencue cant start mayabatch but running it manually works

thanks,
rob

@robina80 robina80 added the bug Something isn't working label Jul 31, 2023
@robina80
Copy link
Author

robina80 commented Aug 3, 2023

can anyone point me in the right direction please, are there more logs i can dig up that give me more details to why opencue didnt start mayabatch correctly?

@malkia
Copy link

malkia commented Aug 27, 2023

I'm just a fresh new user, not sure how much this help but the error above is ERROR_DLL_INIT_FAILED - https://www.hresult.info/FACILITY_NT/0xC0000142 - Check with Event Viewer for errors.

@malkia
Copy link

malkia commented Sep 20, 2023

Ok, I've hit the same on Windows. Turns out RQD was resseting the environment. I'm still finding out what variables are needed, but definitely sanitizing the whole env, and just placing (what looks) like above may not work in all situations. All it take is for some code to rely on these, and then it won't work.

@robina80
Copy link
Author

thanks @malkia i really appreciate it

tbh i thought it was just a case of adding another env variable like you to the windows path but havnt had any luck yet, ive tried to add this to my env variable paths in windows but no joy

C:\Program Files\Autodesk\Arnold\maya2024\bin

obviously you need the below one to start the render cmd so ive added it to my windows paths env var

C:\Program Files\Autodesk\Maya2024\bin

ive changed my rqd.bat

@echo off for /f "tokens=3 delims=: " %%i in ('netsh interface ip show address ^| findstr "10.100" ^| findstr "IP ADDRESS"') do set ip=%%i mkdir %localappdata%\OpenCue echo [Override] > %localappdata%\OpenCue\rqd.conf echo OVERRIDE_HOSTNAME=%ip% >> %localappdata%\OpenCue\rqd.conf echo RQD_USE_PATH_ENV_VAR=True >> %localappdata%\OpenCue\rqd.conf echo DEFAULT_FACILITY=local >> %localappdata%\OpenCue\rqd.conf echo GPU=False >> %localappdata%\OpenCue\rqd.conf echo RQD_TAGS = >> %localappdata%\OpenCue\rqd.conf echo RQD_BECOME_JOB_USER=False >> %localappdata%\OpenCue\rqd.conf set OPENCUE_SERVER=172.17.1.1 set CUEBOT_HOSTS=%OPENCUE_SERVER% set CUEBOT_HOSTNAME=%OPENCUE_SERVER% set CUEBOT_HOSTNAME_OR_IP=%OPENCUE_SERVER% cmd /k "cd D:\programs\OpenCue-0.22.14\venv\Scripts & activate & rqd"

@robina80
Copy link
Author

Can anyone help please, surely someone has stumbled upon this problem with Maya on a pc

@robina80
Copy link
Author

just bumping this as its still an issue

@angelali-ms
Copy link
Contributor

angelali-ms commented Dec 4, 2023

Hello! We ran into this issue when trying to adopt OpenCue into our pipeline as well.
After a lot of debugging, it seems like the SYSTEMDRIVE environment variable is missing when RQD runs mayabatch in a subprocess.

It seems like there's an open PR to allow more environment variables (besides PATH) to get set in RQD (#1324), but in the meantime, I've been adding "set SYSTEMDRIVE=C:\n" to the list of commands when submitting a job via PyOutline. Hope that helps!

@robina80
Copy link
Author

robina80 commented Dec 6, 2023

@echo off
for /f "tokens=3 delims=: " %%i in ('netsh interface ip show address ^| findstr "10.100" ^| findstr "IP ADDRESS"') do set ip=%%i
mkdir %localappdata%\OpenCue
echo [Override] > %localappdata%\OpenCue\rqd.conf
echo OVERRIDE_HOSTNAME=%ip% >> %localappdata%\OpenCue\rqd.conf
echo RQD_USE_PATH_ENV_VAR=True >> %localappdata%\OpenCue\rqd.conf
echo DEFAULT_FACILITY=local >> %localappdata%\OpenCue\rqd.conf
echo GPU=False >> %localappdata%\OpenCue\rqd.conf
echo RQD_TAGS = >> %localappdata%\OpenCue\rqd.conf
echo RQD_BECOME_JOB_USER=False >> %localappdata%\OpenCue\rqd.conf
set OPENCUE_SERVER=172.17.1.1
set SYSTEMDRIVE=C
set CUEBOT_HOSTS=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME_OR_IP=%OPENCUE_SERVER%
cmd /k "cd D:\programs\OpenCue-0.22.14\venv\Scripts & activate & rqd"

as you can see from above ive added set SYSTEMDRIVE=C i dont get the error pop up anymore but the job doesnt run on a host

@robina80
Copy link
Author

robina80 commented Dec 6, 2023

no joy im afraid, even if i changed in my rqd.bat file (above)

set SYSTEMDRIVE=C
set SYSTEMDRIVE=C:
set SYSTEMDRIVE=C:\

@bcipriano is there anyway into getting maya to render with opencue?

@angelali-ms
Copy link
Contributor

From my understanding, the environment variables set in the rqd.bat file unfortunately don't get copied over when a job runs on OpenCue (with one exception).

When RQD runs a job on a Windows machine, it creates a temporary .bat file, launches a new subprocess and runs that temporary .bat file. The environment variables from the RQD machine don't get copied over when the new subprocess gets created (with the exception of PATH).

To get around this, I used PyOutline to submit my own mayabatch command (outside of CueSubmit) and injected the set SYSTEMDRIVE=C: \n command there.

It is admittedly hacky, so it would be nice to be able to have more environment variables copied over to the job - maybe at least SYSTEMDRIVE?

@robina80
Copy link
Author

robina80 commented Dec 6, 2023

yes your right @angelali-ms only path enviroment variables get copied over, non of the other system ones do like

https://pureinfotech.com/list-environment-variables-windows-10/

apart from the path enviroment variable like we said

so were did you put that SYSTEMDRIVE=C: did you put it in the rqd.bat file or in another bat file as the only bat files i have are

rqd.bat
cuesubmit.bat
cuegui.bat
cueadmin.bat

@robina80
Copy link
Author

robina80 commented Dec 6, 2023

im looking at this link to see what overrides i can put in but its a dead link

https://github.com/AcademySoftwareFoundation/OpenCue/blob/master/pyoutline/etc/outline.cfg

@robina80
Copy link
Author

robina80 commented Dec 6, 2023

@angelali-ms
Copy link
Contributor

angelali-ms commented Dec 6, 2023

Ah! For PyOutline, these were the steps that I did to utilize it:

Then, I modified the sample code to include the set env command and the mayabatch command. In particular, I modified this line of code like so:

layer = outline.modules.shell.Shell(
    'mayabatch_layer',  # can rename this to what suits your needs
    command=['set', 'SYSTEMDRIVE=C:', '\n', #mayabatch command here#],
    chunk=1,
    threads=1,
    range='1-1')

Not sure if there's a better way to do this, but this is what has worked so far!

@robina80
Copy link
Author

robina80 commented Dec 6, 2023

thanks @angelali-ms

ive installed pyoutline and pycue this way

basically download all the tar.gz files from here

https://github.com/AcademySoftwareFoundation/OpenCue/releases

once done, extract them to a folder using winrar and i wrote a nifty batch script to install all

@echo off
python -m venv venv
dir /AD /b | FINDSTR /V venv | FINDSTR /V logs > dirs.txt
for /F %%h in (dirs.txt) do cd D:\programs\OpenCue-0.22.14\%%h & D:\programs\OpenCue-0.22.14\venv\Scripts\activate & pip install -r requirements.txt & python setup.py install

i just copied the below into requirements.txt
PySide2==5.15.2.1
QtPy==1.11.3;python_version<"3.7"
QtPy==2.3.0;python_version>="3.7"

then i made batch scripts to run them

rqd.bat
@echo off
for /f "tokens=3 delims=: " %%i in ('netsh interface ip show address ^| findstr "10.100" ^| findstr "IP ADDRESS"') do set ip=%%i
mkdir %localappdata%\OpenCue
echo [Override] > %localappdata%\OpenCue\rqd.conf
echo OVERRIDE_HOSTNAME=%ip% >> %localappdata%\OpenCue\rqd.conf
echo RQD_USE_PATH_ENV_VAR=True >> %localappdata%\OpenCue\rqd.conf
echo DEFAULT_FACILITY=local >> %localappdata%\OpenCue\rqd.conf
echo GPU=False >> %localappdata%\OpenCue\rqd.conf
echo RQD_TAGS = >> %localappdata%\OpenCue\rqd.conf
echo RQD_BECOME_JOB_USER=False >> %localappdata%\OpenCue\rqd.conf
set OPENCUE_SERVER=172.17.1.1
set CUEBOT_HOSTS=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME_OR_IP=%OPENCUE_SERVER%
cmd /k "cd D:\programs\OpenCue-0.22.14\venv\Scripts & activate & rqd"

cuesubmit.bat
@echo off
set OPENCUE_SERVER=172.17.1.1
set CUEBOT_HOSTS=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME_OR_IP=%OPENCUE_SERVER%
cmd /k "cd /d D:\programs\OpenCue-0.22.14\venv\Scripts & activate & cuesubmit

cuegui.bat
@echo off
set OPENCUE_SERVER=172.17.1.1
set CUEBOT_HOSTS=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME_OR_IP=%OPENCUE_SERVER%
cmd /k "cd /d D:\programs\OpenCue-0.22.14\venv\Scripts & activate & cuegui

cueadmin.bat
@echo off
set OPENCUE_SERVER=172.17.1.1
set CUEBOT_HOSTS=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME=%OPENCUE_SERVER%
set CUEBOT_HOSTNAME_OR_IP=%OPENCUE_SERVER%
cmd /k "cd D:\programs\OpenCue-0.22.14\venv\Scripts & activate & cueadmin -server 172.17.1.1 -ls"

so from knowing that do i create another batch running outline?

@angelali-ms
Copy link
Contributor

Nice, I see! Not entirely sure about creating another batch file to run outline or not, but I think a quick test that you can run is this on the Command Prompt:
set OPENCUE_SERVER=172.17.1.1
set CUEBOT_HOSTS=%OPENCUE_SERVER%
D:\programs\OpenCue-0.22.14\venv\Scripts\activate.bat
python

After python is launched, you can copy the code from line 21 to line 33 in the sample code:
https://github.com/AcademySoftwareFoundation/OpenCue/blob/master/samples/pyoutline/basic_job.py#L21C1-L33C46

If that works, then modify line 30 and 31 to the code I linked above. The #mayabatch command here# section will look something like 'Render', '-r', 'file', '-s', '#IFRAME#', '-e', '#IFRAME#', '-cam', 'camera_name', 'maya_file' (where camera_name and maya_file would have to be replaced with the real values). I'm putting this command together by looking at the source code for CueSubmit: https://github.com/AcademySoftwareFoundation/OpenCue/blob/master/cuesubmit/cuesubmit/Submission.py#L39-L43
Our use case didn't require us to use this command, so this might need some fine-tuning :)

Hope that works! 🤞

@robina80
Copy link
Author

robina80 commented Dec 7, 2023

So obviously @angelali-ms you would need to do this manually every time you want to render a file ie It wouldn't be automatic like just submit a job via cuesubmit and it appears in cuegui and then rqd renders it in the background

So rather than submitting the file via cuesubmit, all gui, you submit via outline all command to cuegui and then rqd renders it?

Sorry for the daft question

@angelali-ms
Copy link
Contributor

Yup, that's a good way of phrasing it - it would be all command rather than all gui. Sorry for not phrasing things well.
There are ways to write Python scripts to make the submission process easier, but it would be moving away from cuesubmit.

I do think it's worth trying out the test above, and if it works for you, then maybe it's worth submitting a Pull Request to get the SYSTEMDRIVE environment variable copied over for Windows jobs (I would be happy to try that! It would be my first time contributing to open source, so might need some guidance). @bcipriano, would you happen to have any thoughts on this?

@malkia
Copy link

malkia commented Dec 7, 2023

Would it be possible to have some way (an option?) to not clear existing environment (as dirty as it is, it's not as well speced out as on other systems. There might be even some licensing vars too).

@robina80
Copy link
Author

robina80 commented Dec 8, 2023

great, this is a step in the right direction!!!

i ran first this

import getpass
import outline
import outline.cuerun
import outline.modules.shell
ol = outline.Outline(
'basic_job', shot='shot01', show='testing', user=getpass.getuser())
layer = outline.modules.shell.Shell(
'echo_frame', command=['echo', '#IFRAME#'], chunk=1, threads=1, range='1-5')
ol.add_layer(layer)
outline.cuerun.launch(ol, use_pycuerun=False)

and the job finished with success

now running the maya file

import getpass
import outline
import outline.cuerun
import outline.modules.shell
ol = outline.Outline(
'basic_job', shot='shot01', show='testing', user=getpass.getuser())
layer = outline.modules.shell.Shell(
'mayabatch_layer',
command=['set', 'SYSTEMDRIVE=C:', '\n', 'Render', '-r', 'file', '-s', '#IFRAME#', '-e', '#IFRAME#', '-cam', '020', 'D:\programs\renders\TEST.ma'],
chunk=1,
threads=0,
range='1-100')
ol.add_layer(layer)
outline.cuerun.launch(ol, use_pycuerun=False)

i see the job in cuegui but the job dies as it thinks the maya file is just D:\programs
enders\TEST.ma

but its actually starting mayabatch now which is great as i can see in the logs where as before it just errored trying to start mayabatch!!!

@angelali-ms
Copy link
Contributor

@robina80 that's great news!! :D
@malkia it seems like there are two open pull requests that do just that - not sure what the status is for them though:

@robina80
Copy link
Author

robina80 commented Dec 8, 2023

so we worked out by default out the box opencue doesnt work with windows maya which is a big bumer tbh and to make it work you need to heavily mod it and even doing so you cant use cuesubmit

@bcipriano can you guys make opencue work out the box with windows maya?

@robina80
Copy link
Author

robina80 commented Dec 8, 2023

or can you add systemdrive to the envs

env SP_NOMYCSHRC=1
env SYSTEMROOT=C:\Windows
env TERM=unknown
env TMP=C:\Users\gfx14_uk\AppData\Local\Temp
env TZ=PST8PDT
env USER=gfx14_uk
env frame=0001-370
env jobhost=10.110.110.200

just add a new env systemdrive ?

can we add new envs?

@robina80
Copy link
Author

robina80 commented Dec 9, 2023

@angelali-ms have you tried installing cuesubmit in maya

https://www.opencue.io/docs/getting-started/installing-cuesubmit/

you think that will work?

EDIT - answered my own question, no it doesnt work as still get the pop ups all the time "mayabatch.exe application error"

@robina80
Copy link
Author

hi @bcipriano @splhack @DiegoTavares @sharifsalah @akim-ruslanov @lgritz

you think this can be addressed as atm maya for windows just does not work with opencue at all, ive installed cuebot server on linux and the rest ie rqd/submit/gui/admin/outline/cue on windows and blender on windows works fine with opencue but as said maya just does not work as @angelali-ms theres a hack of getting it to work but it would be nice if this was addressed

@malkia
Copy link

malkia commented Dec 14, 2023

I've got maya, or at least mayabatch to work for us, by hacking RQD to preserve environment variables. Can't remember now whether admin mode or not was needed (our setup is to run RQD through just simple Startup Applications).

@robina80
Copy link
Author

robina80 commented Dec 14, 2023

So all you did was set a task schedule to run rqd as admin?

EDIT - running the rqd.bat file as admin doesnt work, still get those pesky mayabatch.exe error pop ups, it just doesnt work with windows maya by default

@angelali-ms
Copy link
Contributor

Hi! Just created a draft pull request for a fix that I believe will get CueSubmit Maya jobs working on Windows RQDs. Will work out some things in the back end and mark the request ready for review :)

@robina80
Copy link
Author

robina80 commented Feb 7, 2024

so @bcipriano as this is closed now as its now fixed, how can i test to see if it works

@robina80
Copy link
Author

robina80 commented Feb 7, 2024

i see it, nice one thanks to all of you @bcipriano @angelali-ms

https://github.com/AcademySoftwareFoundation/OpenCue/tree/master/rqd/rqd

@robina80
Copy link
Author

robina80 commented Feb 7, 2024

i was really hoping this would cure it but it doesnt, i get the dreaded mayabatch error pop up

i got all the latest releases again from here

https://github.com/AcademySoftwareFoundation/OpenCue/releases/tag/v0.22.14

untared them all using winrar, put them all in c:\opencue and then made this batch to work the magic

@echo off
python -m venv venv
dir /AD /b | FINDSTR /V venv | FINDSTR /V logs > dirs.txt
for /F %%h in (dirs.txt) do cd c:\opencue%%h & c:\opencue\venv\Scripts\activate & pip install -r requirements.txt & python setup.py install

i copied/pasted the requirments gui in the requirements

this is the error i get

c:\opencue\venv\Scripts>Render -r file -s 1 -e 1 -cam [None] C:/renders/TEST.ma

Starting "C:\Program Files\Autodesk\Maya2024\bin\mayabatch.exe"
// Maya exited with status -1073741502

and on cuegui i all the time get the error pop up

im sorry guys

@angelali-ms
Copy link
Contributor

@robina80 I looked through the release changes for v0.22.14, and it doesn't seem like my change is on there. Might have to wait for the next release to test, sorry about that!

@robina80
Copy link
Author

robina80 commented Feb 7, 2024

ok thanks @angelali-ms i was being dumb, so i added SYSTEMDRIVE to line 104 exactly like how you did in the pull

i didnt know where to add it ie in c:\opencue\rqd-0.22.14-all... or c:\opencue\venv... so i added it to both

now when i run maya and submit the job it submits it to gui and now i dont get the poxy mayabatch errors anymore, i can hear my pc take off so its running frames and it says "running" but then the frames go "dead" so this is def a step in the right direction

@robina80
Copy link
Author

robina80 commented Feb 7, 2024

ok scrap that @angelali-ms its working, i forgot when i submited the job to gui i forgot to add the "render cameras" camera1, before i put none

now it done the first bunch of frames 1-9 as "succeeded"

you guys are awesome @angelali-ms @bcipriano thanks for all coming together and working on this problem!!!!!!!!

@angelali-ms
Copy link
Contributor

Amazing, that's great to hear! Happy to help :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants