Closed kalmarek closed 1 year ago
remove the whole init() hackery
__init__
is required so that someone can overload the binaries.
I'm in favor of keeping Requires for now. It seems to be working, and asking people to explicitly opt into CUDA_jll
(or CUDA_Runtime_jll
) seems okay.
hmm? what do you mean override the binaries? The standard way I do it is to SCS_GPU_jll.dev_jll()
and then replace the new library in .julia/dev/SCS_GPU_jll/override/lib
; How do you do it with __init__
?
__init__
needs to load the new path and set the global
, otherwise the path gets baked into the precompiled image and the new dev_jll()
path isn't used.
hmm, maybe I'm missing something: If you're in SCS
project and you
pkg"dev SCS_GPU_jll"
import SCS_GPU_jll
SCS_GPU_jll.dev_jll()
using SCS
will precompile the dev-ed SCS_GPU_jll
with the override set. The only situation when this goes wrong is when using SCS
happens between dev
and dev_jll()
?
See https://github.com/jump-dev/ECOS.jl/pull/134 https://github.com/jump-dev/SCS.jl/pull/248
This can also occur if you use https://jump.dev/JuMP.jl/stable/developers/custom_solver_binaries without the pkg"dev
.
I see, it's about relocability, thanks!
We will still need to think what to do about CUDA_Runtime_jll
I just did an experiment locally and it turns out we could just drop
Requires
and remove the whole__init__()
hackery:works just fine. The only difference is that when you try to use e.g.
SCS.GpuIndirectSolver
without installing CUDA first you'll get (sorry for errors in german ;)If CUDA (e.g. through
CUDA_jll
) is installed but no GPU is present SCS will throw a standard CUDA error (no CUDA device found
or so).The benefits of doing this:
MKL_jll
/CUDA_jll
somewhere andMKLDirectSolver
/GpuIndirectSolver
will be operationalMKL_jll
/CUDA_jll
beforeSCS
,CUDA_jll
is deprecated (and it has just a dozen new users in the last month, see https://juliahub.com/ui/Packages/CUDA_jll/nSfHz/11.8.0+0), so we will need to move away from it anyway;CUDA_Runtime_jll
(8.5k new users) is the new way to go, although I haven't figured out how to use it yet.Drawbacks of dropping
Requires
available_solvers
are gone (but one could cook up some__init__
to bring them back).@odow Are we happy with the status quo, should we load SCS_GPU_jll unconditionally, or should we work on a solution with
CUDA_Runtime_jll
?