# A package with multiple support for multiple GPU types

**URL:** <https://discourse.julialang.org/t/a-package-with-multiple-support-for-multiple-gpu-types/137789>\
**Category:** General Usage\
**Tags:** package\
**Created:** [June 24, 2026, 9:27pm UTC](https://discourse.julialang.org/t/a-package-with-multiple-support-for-multiple-gpu-types/137789 "2026-06-24T21:27:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BananaMaster3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bananamaster3/32/218457_2.png) [@BananaMaster3](https://discourse.julialang.org/u/BananaMaster3)\
**Post date:** [June 24, 2026, 9:27pm UTC](https://discourse.julialang.org/t/a-package-with-multiple-support-for-multiple-gpu-types/137789/1 "2026-06-24T21:27:47Z")

</div>

Hey all!

I’m currently working on a package that uses the GPU. Being a good citizen, I’m adding support for different pipelines (via KernelAbstractions.jl, if that helps). How should I architect this in the package?  
I obviously don’t want the user installing oneApi.jl if they have CUDA, but how can I make `Pkg.instantiate()` platform specific?

Thanks!

---

<div class="post-metadata">

**Author:** ![Tortar](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Post date:** [June 25, 2026, 1:19am UTC](https://discourse.julialang.org/t/a-package-with-multiple-support-for-multiple-gpu-types/137789/2 "2026-06-25T01:19:16Z")

</div>

I think the easier and more recommended option is not to have the backends as deps, but make the user install what he/she wants to use and then somehow communicate to the package that. Can’t you do so?

---

<div class="post-metadata">

**Author:** ![PatrickHaecker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrickhaecker/32/222891_2.png) [@PatrickHaecker](https://discourse.julialang.org/u/PatrickHaecker)\
**Post date:** [June 25, 2026, 3:42am UTC](https://discourse.julialang.org/t/a-package-with-multiple-support-for-multiple-gpu-types/137789/3 "2026-06-25T03:42:34Z")

</div>

Do you have an [app package or a library package](https://discourse.julialang.org/t/does-manifest-toml-belong-in-the-repository/12029/2)?

For a library package, you probably should not have a Manifest.toml, so there should not be a problem with `instantiate` to begin with.

For an app package, I think the user should be free to choose on their own (they might even decide to use the CPU because their GPU is busy with some other stuff). Using preferences and potentially package extensions might help. As far as I know there are no union dependencies, so you can’t depend on `oneAPI.jl OR CUDA.jl`.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/224680_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [June 25, 2026, 4:00am UTC](https://discourse.julialang.org/t/a-package-with-multiple-support-for-multiple-gpu-types/137789/4 "2026-06-25T04:00:08Z")

</div>

You might also be interested in the following packages:

- Adapt.jl
- GPUSelect.jl
- JACC.jl
