conda-forge / conda-forge.github.io

The conda-forge website.
https://conda-forge.org
BSD 3-Clause "New" or "Revised" License
132 stars 277 forks source link

GPU Support? #63

Closed alexbw closed 11 months ago

alexbw commented 8 years ago

I've got a couple packages I'm preparing for upload that rely on GPUs. I'm not up to speed on what open-source CI solutions offer, but would building against a VM w/ GPUs be supported? If it would require pitching in or donating to the project, I'm pretty sure I can figure some way to help.

jakirkham commented 6 years ago

Hmm...is there someone or someones from NVIDIA at SciPy? Maybe we can find a better contact than the public facing generic OSS support email.

jchodera commented 6 years ago

Mark Berger is the Senior Alliance Manager for Life & Material Sciences at NVIDIA, and has always been tremendously helpful to us in connecting up with the right folks inside the organization to troubleshoot. I'd connect up with him if you have any trouble finding the right person inside of NVIDIA.

hadim commented 6 years ago

Any news on this? Having cuda as a conda package would be great!

scopatz commented 6 years ago

Yes, unfortunately, our legal counsel (via NumFOCUS) informed us that according to the cudatoolkit EULA, we are not allowed to redistribute cudatoolkit. We'll need to get special permission to redistribute these packages. I'll be attempting to pursue this with them.

hadim commented 6 years ago

That's suck... But thank you to keep trying @scopatz and others. Let us know here.

scopatz commented 6 years ago

No problem! I am sure having other people ask NVIDIA for this, too, can only help our case :)

isuruf commented 6 years ago

We'll need to get special permission to redistribute these packages.

Given that we are okay with the indemnify clause, do we need special permission if we use cudatoolkit from defaults and use that to build packages?

scopatz commented 6 years ago

Yes, I think so. Anaconda Inc is who assumes all legal risk from the defaults packages

alexbw commented 6 years ago

Hey all, it looks like PyTorch (very popular ML package) copies CUDA .so files directly into site-packages. Those folks might know about licensing. https://github.com/pytorch/pytorch/blob/2681852438f9f80b43fd2502d83839140733b68c/conda/integrated/build.sh#L61-L119

scopatz commented 6 years ago

@alexbw - they either are breaking the license or (more likely) have another license from NVIDIA to do so.

dgasmith commented 5 years ago

@scopatz We could potentially poke Nvidia about this as well from a fairly large userbase that is often featured in their advertisements (molecular dynamics). Do you already have a contact within the company or should we reach out to our local Nvidia representative?

@jchodera @Lnaden

jchodera commented 5 years ago

@dgasmith: We have found Mark Berger, the Senior Alliance Manager, Life & Material Sciences, to be incredibly helpful. He could likely put you in touch directly with the people necessary to grant license exceptions. I'd be happy to introduce you via email.

dgasmith commented 5 years ago

Mark is exactly who was on my mind :)

I do want to know who at Nvidia has already been contacted so that the right folks can get synced together and not have too many loose efforts.

hmaarrfk commented 5 years ago

@scopatz did the legal council state what clause made the cuda toolkit non-redistributable?

Are we allowed to link to cuda stuff so long as we pull in the dependency from defaults?

Ref: https://docs.nvidia.com/cuda/eula/index.html#attachment-a xref: https://github.com/conda-forge/pytorch-cpu-feedstock

scopatz commented 5 years ago

Basically, counsel has said that the EULA - even attachment A - only refers to applications (it does), and conda-forge cannot be considered an application under any reasonable definition.

Also, it looks like they have added the following to attachment A, which we don't meet:

The NVIDIA CUDA Driver Libraries are only distributable in applications that meet this criteria:

1. The application was developed starting from a NVIDIA CUDA container obtained from Docker Hub or the NVIDIA GPU Cloud, and
2. The resulting application is packaged as a Docker container and distributed to users on Docker Hub or the NVIDIA GPU Cloud only.
hmaarrfk commented 5 years ago

I guess we can't distribute the Cuda driver. Many people are OK with installing that themselves :/.

Second question would be: Is linking to the libraries on defaults OK by conda-forge standards?

scopatz commented 5 years ago

Linking to the deafults libraries is fine for us

hadim commented 5 years ago

Then we can say goodbye to reproducible workflow involving CUDA. This is really a non sense we can't ship it in conda-forge.

I understand the legal aspect of it. What I don't understand is why they took that decision...(unless it's a misunderstanding and we can actually ship it conda?)

scopatz commented 5 years ago

Then we can say goodbye to reproducible workflow involving CUDA. This is really a non sense we can't ship it in conda-forge.

I understand the legal aspect of it. What I don't understand is why they took that decision.

I agree on all counts.

(unless it's a misunderstanding and we can actually ship it conda?)

From speaking with NVIDIA, I am reasonably sure that this is not a misunderstanding on their part. The folks who work on ML and cuda and PyData stuff at NVIDIA are different than those in their legal department. I don't know the justification for the license as it stands, but we have to live with it until:

  1. they change the EULA
  2. they give us a written exception, which I have asked for but they haven't responded yes or no
hadim commented 5 years ago

Thank you @scopatz for working on all those things.

In the meantime for those who want to have reproducible CUDA installation (only Linux unfortunately), see the following gist: https://gist.github.com/hadim/a4fe638587ef0d7baea01e005523e425

ericpre commented 4 years ago

Now that building package with CUDA is working fine on linux (in case of https://github.com/conda-forge/prismatic_split-feedstock, it went smoothly), how would it be possible to add windows support? Is it worth trying to add a cudatoolkit-dev package for windows in order to build GPU packages on windows?

isuruf commented 4 years ago

PRs welcome. We could use cudatoolkit-dev in Linux too to avoid using /usr/include because NVIDIA images have been polluting the includes into that folder.

ericpre commented 4 years ago

Ok, I will give a try.

jakirkham commented 4 years ago

@ericpre, for an example of how to build GPU packages would take a look at nvidia-apex as a simple example. Sorry there are no docs atm.

isuruf commented 4 years ago

@jakirkham, does nvidia-apex-feedstock build windows cuda packages?

znmeb commented 4 years ago

I've got an NVIDIA Jetson AGX Xavier (8-core Tegra aarch64 CPU plus a 512-core Volta GPU) that I can test on. I just discovered Miniforge a couple of days ago - it appears to be working out of the box on the Tegra CPU.

I also have a laptop with a GTX 1050 Ti GPU / x86_64 CPU but there's plenty of other ways to get at the GPU there.

tyler274 commented 3 years ago

Why isn't OpenCL included in OpenCV already. CI support and license issues aren't an issue so why is it blocked on Cuda?