If you have multiple engines on your classpath, DJL will evaluate them in order given by classloader's listing of "native/lib/" + engine + ".properties" resources. The first acceptable engine is selected. The ClassLoader's resource listing is documented as "the ordering is not specified and may be very unpredictable"
This would be OK-ish, except the evaluation accepts a CPU engine even if the current system is CUDA capable. So if you have both, and the system is CUDA capable, you might or might not get CUDA from run to run.
Expected Behavior
If current platform is CUDA, find CUDA engine. Only if it's missing, use CPU engine.
In general, perhaps forcing the order to anything consistent might be a good idea.
I realise most systems will not have a random combination of engines, but in our case we distribute with CPU engine and drop CUDA engine as a plugin, and that's what we end up with.
Description
See
Platform::detectPlatform()
method.If you have multiple engines on your classpath, DJL will evaluate them in order given by classloader's listing of
"native/lib/" + engine + ".properties"
resources. The first acceptable engine is selected. The ClassLoader's resource listing is documented as "the ordering is not specified and may be very unpredictable"This would be OK-ish, except the evaluation accepts a CPU engine even if the current system is CUDA capable. So if you have both, and the system is CUDA capable, you might or might not get CUDA from run to run.
Expected Behavior
If current platform is CUDA, find CUDA engine. Only if it's missing, use CPU engine. In general, perhaps forcing the order to anything consistent might be a good idea.
I realise most systems will not have a random combination of engines, but in our case we distribute with CPU engine and drop CUDA engine as a plugin, and that's what we end up with.