Closed niskander closed 4 years ago
I think it is part of a big problem which is stated in the issue #2595, and yet has no solution.
IMHO, we need both enabled at the same time, Mono is far slower than il2cpp. For complex scenes we could easily speed up the training by 2x or more just by having it compiled with il2cpp.
Hi @niskander,
We added a link.xml
file between 0.9 and 0.12 under the Plugins/ProtoBuffer folder. If you remove this, you should be able to link with your macro modifications. We are still investigating the best way to handle this issue. Thank you for your patience.
@surfnerd Deleting the xml file does indeed fix the issue. Thanks!
@caioc2 Yeah it would definitely be great if they were actually compatible.
is there any news about this bug? I can't use a trained network in my android\iOS game because il2cpp is required for these platforms what should I do to be able to build for andoird\iOS with il2cpp backend?
@chechulinYuri @surfnerd I saw an IL2CPP file in the latest release (0.14) with a comment that says the issue should be fixed for inference, so maybe. I kept my old workaround so can't confirm. @surfnerd can you confirm?
Hi @niskander, There were some stubs added that fixed compilation on windows and only inference works. I spent some time last week trying to get training to work with IL2CPP and a newer version of gRPC, but ran into a bunch of deadlocks with the interaction between gRPC and Mono in the Unity Editor.
Long story short: IL2CPP still isn't working with ML-Agents yet, but it may compile and be able to run inference on some platforms.
@surfnerd Thanks for the response. It's good to see progress on that front, but just so I fully understand, is gRPC actually used for inference? I was under the impression that it was only used for training.
Hi @niskander, gRPC is not used for inference, sorry for the confusion. There is a build issue with gRPC and IL2CPP. With the way our code is currently organized, we include gRPC with builds no matter if you are training or not. For reasons unknown to us at this time, training does not work when IL2CPP is enabled.
The file you see in the repo fixes gRPC link errors on windows for standalone builds with IL2CPP enabled, yet training still does not work. So you can technically build a standalone player with IL2CPP enabled, but you cannot train with it. You can only run inference.
Does that make sense?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi, I just updated MLAgents from version 0.9 to 0.12 and started having issues with GRPC and IL2CPP.
The goal is for the game to compile with IL2CPP and GRPC together, but I don't need them both enabled at the same (i.e. when training is running GRPC is enabled and IL2CPP is disabled).
In 0.9, this was possible by modifying the macros in the following 2 files: RpcCommunicator.cs and UnityToExternalGrpc.cs to exclude GRPC when IL2CPP is enabled.
After updating to 0.12, this no longer works due to linker errors. It seems like Mac & Linux dlsyms are still required by Grpc.core even when it's compiling for windows and even when GRPC is excluded from the unity project using the macros mentioned above. I found a potential fix here, but it requires recompiling GRPC.
It would be great if this fix can be included in the plugin. I already have to recompile Protobuf every time I update MLAgents to make it compatible with the Protobuf included in the AWS plugin. Having to fix and recompile GRPC as well makes updating extremely difficult.