How can I get Seqera containers to build a CUDA-en...
# nostupidquestions
j
How can I get Seqera containers to build a CUDA-enabled environment? AFAIK this error means that CUDA is not enabled on the build runner?
Copy code
#10 37.13 error    libmamba Could not solve for environment specs
#10 37.13     The following package could not be installed
#10 37.13     └─ pytorch-gpu =2.12 * is not installable because it requires
#10 37.13        └─ pytorch [==2.12.0 cuda*_generic*200|==2.12.0 cuda*_generic*201|...|==2.12.1 cuda*_mkl*300], which requires
#10 37.13           └─ __cuda =* *, which is missing on the system.
For the following environment YAML:
Copy code
channels:
  - conda-forge
  - bioconda
dependencies:
  - bioconda::comebin-llmopt=1.1.2
  - conda-forge::gzip=1.14
  - conda-forge::tar=1.35
  - conda-forge::pytorch-gpu=2.12
  - conda-forge::cuda-version=12.9
j
Thanks Mahesh!
Did you ever just try running the Wave CLI with
--config-env="CONDA_OVERRIDE_CUDA=12"
?
(it didn’t work)
This method won’t push the image to Sequera containers?
Copy code
Wave invalid response: [400] {"message":"Attribute buildRepository must be specified when using freeze mode [1]"}
m
Hmm. I’m not sure. I could have sworn that command worked in the test at the time. Does it work if you build locally (without the dockerfile) and pass in the lock file instead?
j
I don’t have a lock file to hand. The other problem is the build times out because one of the conda packages has a post-run script that pulls and unpacks a big database
@Phil Ewels you know a lot about wave, maybe you know an approach that might work?
p
You can’t push Dockerfiles to Seqera Containers, only conda works (to avoid abuse / people using us for free file hosting)
Wave works fine, just a restriction for the community registry (Seqera Containers)
And yeah, these massive CUDA images are a pain because they’re so huge
👍 1
I think @Florian Wuennemann has spent some time trying to get these kinds of images to work, maybe?
j
@Diego Alvarez Saravia built the image locally and it was 23Gb 🤦‍♂️🤦‍♂️
p
oof
j
I should have read the docs here more thoroughly I think: https://nf-co.re/docs/developing/components/gpu-modules Perhaps with the tips there and fixing a longer CLI await time will fix the issue. Will try tomorrow
p
Maybe, but I don’t think that 23Gb is going to work on CI / most places.. Even if it does build.
I would have reacted violently to even the suggestion until recently, as CloudFlare doesn’t cache objects that large so Seqera gets charged for every pull. But Paolo did some magic on Wave layering recently so it should be ok, maybe. But still, it’s making me nervous 😅
d
For reference, 23 uncompressed. The image is around 8-9GB.
phew obama 1
And I also found that conda cache is not getting cleaned from the image, so 6 of those 23 are cached packages
p
ok, that’s good phew obama 😅
f
Oh yeah, CUDA images are generally a real pain due to their size. I don't think I have any extra tricks here beside the general: use only the minimal stuff necessary, check if you can use the minimal cuda stack you need etc
🙏🏻 1
j
In general, if I can’t get Seqera containers to build this - is there another nf-core approach to build and host them manually?
p
yes: quay.io for nf-core
👍 1
j
This worked:
Copy code
>wave --freeze --await=2h --conda-file=environment.gpu.yaml --build-template=conda/micromamba:v2 --tower-token <> -o json

{"buildId":"bd-bae10c4b04932650_3","cached":false,"containerImage":"community.wave.seqera.io/library/comebin-llmopt_gzip_tar_pytorch-gpu_cuda-version:bae10c4b04932650","freeze":true,"mirror":false,"requestId":"6706cdc4b9f2","scanId":"sc-e4c19b11a2bcf7fe_1","succeeded":false,"targetImage":"community.wave.seqera.io/library/comebin-llmopt_gzip_tar_pytorch-gpu_cuda-version:bae10c4b04932650"}
🙌🏽 1
Or… not? Build log says no… wave.seqera.io/view/builds/…
😢 1
Copy code
#12 37.59 error    libmamba Could not solve for environment specs
#12 37.59     The following package could not be installed
#12 37.59     └─ pytorch-gpu =2.12 * is not installable because it requires
#12 37.59        └─ pytorch [==2.12.0 cuda*_generic*200|==2.12.0 cuda*_generic*201|...|==2.12.1 cuda*_mkl*300], which requires
#12 37.59           └─ __cuda =* *, which is missing on the system.
…
OK, I think this is literally a case of it timing out
Clearly
--await
is capped at a non-sufficient value
p
I think the maximum build time is 15 mins.. So if the error hits at around that time then that’s probably your cause
Duration 15:56
Yup 👆🏻
j
The claim on the docs is that if you provide a token it’s capped at 25 mins. So that doesn’t seem to be working
🤔 1
p
Will check: do you have the docs link handy please?
j
I think I actually kicked off that build without a token, and then tried to run another with. I’m running it again to confirm
(not on my usual machine today)
Failed after 43 minutes…
Same dockerfile builds locally in 16 minutes (Mac + M1 Pro)
Exit 137 - could be size or memory
Guess I’m going to make my own container. But we won’t get the complementary Singularity image 😭
github.com/nf-core/modules/blob/…/wave.yml.dev It looks like we have automation for building from a dockerfile?
p
Copy code
# NOTE This should get skipped because generate-matrix won't run
    # if: github.repository == 'nf-core/modules'
But yeah, that workflow was added back in 2024 and as far as I can tell, never really used?
Might be that @Edmund didn’t realise at the time about custom Dockerfile builds not working with Seqera Containers?
ah hang on, there it is - a bit further down: github.com/nf-core/modules/blob/…/wave.yml.dev#…
So it uses Wave to build from a dockerfile, then freezes and uses
--build-repo
to tell Wave to push the image to quay.io (hence not using Seqera Containers hosting)
This is coming back to me slowly now, I vaguely remember this going in
j
My suspicion is that if this won’t build for Seqera containers it won’t build on Wave more generally in this way. I've built it locally now and we can push it to quay manually I think. Will have a go tomorrow
👍🏻 1
p
Ah yeah, build and frozen image hosting are separate considerations.
j