Lito
Ansys Employee

@xh19363, 

Just to add, API/script (lumapi, lumopt) is part of our CAD/GUI environment and will require a GUI connection and a GUI license to run. 
>Lumerical product components and licensing overview – Ansys Optics 
>Python API overview – Ansys Optics 

If you want to run the scripts without a GUI/Desktop connection, we have the KB below as a workaround. With newer versions of Lumerical you can use the "QT_QPA_PLATFORM" variable together with (hide=True) option. For the older versions you can use virtual display (Xvfb). Note that running the script (.py or .lsf) even with the CAD/GUI 'hidden' will always checkout a GUI license. 
>Running CAD jobs on headless Linux systems – Ansys Optics