One possible explanation I have for this is that config.cudaSupport = true; enables CUDA for way too many packages than is needed and that might be a bit overkill. When I enabled it in the shell above, everything was compiling okay until it began building onnxruntime and that’s where my system freezes.
Having uncached dependencies indicates to me that they may not being built with this option enabled, but I don’t really know how to check.
On my system, I tried to enable this option once and faced a similar issue, that’s why I’ve opted to enabling CUDA on a per-package basis instead, using overrides/overlays like the one for ctranslate2 and I haven’t had any issues with that approach.