# CUDA.jl compiles to 15GB

**URL:** https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040
**Category:** GPU
**Tags:** cuda
**Created:** [January 27, 2021, 8:39am UTC](https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040 "2021-01-27T08:39:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ribeiro](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)
#### Post date: [January 27, 2021, 8:39am UTC](https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040/1 "2021-01-27T08:39:48Z")

</div>

Hi.  
I’m trying to use PackageCompiler and CUDA. PackageCompiler makes even the smallest program around 150MB because it adds almost all of Julia to it. But when using CUDA, the smallest program seems to have 15GB in the artifacts folder.  
That’s a bit much and I don’t really understand where it’s all coming from. Any way to reduce that?  
Thanks a lot!

---

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [January 27, 2021, 8:52am UTC](https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040/2 "2021-01-27T08:52:50Z")

</div>

Yes, that’s a bug/feature of PackageCompiler where it gathers all artifacts. CUDA.jl has lazy artifacts for all versions of CUDA, so PackageCompiler should probably skip lazy artifacts.

---

<div class="post-metadata">

### Author: ![Ribeiro](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)
#### Post date: [January 27, 2021, 9:06am UTC](https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040/3 "2021-01-27T09:06:16Z")

</div>

Thanks! Is there a way to fix it? Even if it means manually (I’d make a script) deleting some of the stuff that’s not used? Is there a way to figure out what is really needed?  
Thanks again!

---

<div class="post-metadata">

### Author: ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)
#### Post date: [January 27, 2021, 9:08am UTC](https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040/4 "2021-01-27T09:08:34Z")

</div>

I think you can just delete the CUDA artifacts, it’ll redownload them at run time. Or patch PackageCompiler, the logic processing artifacts is pretty simple.

---

<div class="post-metadata">

### Author: ![Ribeiro](https://avatars.discourse-cdn.com/v4/letter/r/d9b06d/32.png) [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)
#### Post date: [January 27, 2021, 9:56am UTC](https://discourse.julialang.org/t/cuda-jl-compiles-to-15gb/54040/5 "2021-01-27T09:56:20Z")

</div>

You’re right, deleting everything under artifacts makes the code download a subset of them at runtime (15GB to 4GB! Progress!). You’re saying I should try to patch the code so that less artifacts get in there. Maybe I can look into CUDA.jl at some point to do that, to see what dependencies I need (maybe create a subset of CUDA.jl). My objective would be to have a reasonably sized compiled folder, so I’d want to reduce the stuff that gets downloaded at run time as well.  
Thanks!
