You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But to do that, CUDA_Runtime_jll needs to be loaded first - since it's a low-level package, it's much better of in the [extras] section of the current project then in it's direct dependencies. But it its now a direct dependency, it can't be loaded directly, so we don't have access to the CUDA_Runtime_jll object. But what about using the UUID of CUDA_Runtime_jll? That'll would do the trick:
it's set's the preference and would add CUDA_Runtime_jll to [extras] automatically. But it's not that easy because what happens is
julia> Preferences.set_preferences!(Base.UUID("76a88914-d11a-5bdc-97e0-2f5a05c973a2"), "version"=>"local")
ERROR: Cannot set preferences of an unknown package that is not loaded!
It does work, however, if CUDA_Runtime_jll is already in the [extras] section of the current project. So it's a bit of a chicken-and-egg problem, and the only way seems to be adding CUDA_Runtime_jll to [extras] manually. That makes it hard to provide simple set-up commands/scripts for systems to users, especially if they don't have much Julia experience yet (tutorial scenarios, etc.). Unfortunately there seems to be no user-accessible functionality in Pkg that adds a dependency to [extras] instead of [deps].
The text was updated successfully, but these errors were encountered:
oschulz
changed the title
Making it possible to set a preference for a non-installed package?
Making it possible to set preferences for a non-installed package?
May 25, 2023
This came up in the context of CUDA.jl:
JuliaGPU/CUDA.jl#1922 (comment)
To use a non-artifact/system-wide CUDA installation, the "official" way it to use
but that results in a multi-GB download of the CUDA runtime artifacts, only to then switch to not using them. As an alternative, one can use
But to do that, CUDA_Runtime_jll needs to be loaded first - since it's a low-level package, it's much better of in the
[extras]
section of the current project then in it's direct dependencies. But it its now a direct dependency, it can't be loaded directly, so we don't have access to theCUDA_Runtime_jll
object. But what about using the UUID of CUDA_Runtime_jll? That'll would do the trick:it's set's the preference and would add CUDA_Runtime_jll to
[extras]
automatically. But it's not that easy because what happens isIt does work, however, if CUDA_Runtime_jll is already in the
[extras]
section of the current project. So it's a bit of a chicken-and-egg problem, and the only way seems to be adding CUDA_Runtime_jll to[extras]
manually. That makes it hard to provide simple set-up commands/scripts for systems to users, especially if they don't have much Julia experience yet (tutorial scenarios, etc.). Unfortunately there seems to be no user-accessible functionality inPkg
that adds a dependency to[extras]
instead of[deps]
.Maybe we could add allow
as well? It could warn that the package hasn't been installed yet and add it to
[extras]
(and set the preference(s), of course).Or maybe this is already possible in some other way with Preferences?
CC @vchuravy
The text was updated successfully, but these errors were encountered: