coreylowman / cudarc

Safe rust wrapper around CUDA toolkit
Apache License 2.0
483 stars 65 forks source link

Is there a way to get this to compile on a Mac? #256

Closed JohnAllen closed 2 weeks ago

JohnAllen commented 2 weeks ago

I mostly develop on a Mac and of course run CUDA code like cudarc on a linux machine with a GPU.

I am trying to compile my code on a mac though instead of having to push it to my linux machine.

Is there a way to do this? I started working on it and added cuda.h where this crate was looking for it, which surprisingly got me past that code-boss. The next boss is giving me missingas_device_ptrin implementation.

There is stuff like this which makes me think that it is possible: https://developer.nvidia.com/nvidia-cuda-toolkit-11_6_0-developer-tools-mac-hosts

So I'm just wondering is this possible at all to do?

coreylowman commented 2 weeks ago

Unfortunately no - nvidia doesn't support running on mac. Mac has their own special GPU library afaik

JohnAllen commented 2 weeks ago

It's just compiling I mean, not actually running. @coreylowman

coreylowman commented 2 weeks ago

Ah, I see! So you’re cross compiling for a different target OS? You should be able to use the normal cargo commands for cross compiling. And then you’ll have to explicitly pick a cuda toolkit version feature (e.g. ‘cuda-12050’) instead of using ‘cuda-version-from-build-system’. On Jun 14, 2024, at 12:53 AM, John Allen @.***> wrote: It's just compiling I mean, not actually running. @coreylowman

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>