Force package to download (specific) lazy artifacts

I’m building a read-only container for a Julia application. It relies on third-party packages, in particular CUDAjl, that have a bunch of lazy artifacts that are only downloaded based on the system type or CUDA version.

How can I force specific drivers to be downloaded in a less hacky way than I’m currently doing in the following:

julia -E "using Pkg.Artifacts; ensure_artifacts_installed("CUDA10.1", $ARTIFACTS)"

In particular, the way I’m using to find the artifacts file has a strong code smell about it.

1 Like

This seems to work:

import Pkg, Artifacts, CUDA

toml = Artifacts.find_artifacts_toml(pathof(CUDA))

for a in ["CUDA110", "CUDNN_CUDA110", "CUTENSOR_CUDA110",
          "CUDA111", "CUDNN_CUDA111", "CUTENSOR_CUDA111"]
  Pkg.Artifacts.ensure_artifact_installed(a, toml)