nlesc-recruit / cudawrappers

C++ wrapper for the Nvidia C libraries (e.g. CUDA driver, nvrtc, cuFFT etc.)
https://cudawrappers.readthedocs.io/en/latest/
Apache License 2.0
4 stars 5 forks source link

cudawrappers on Windows #253

Open loostrum opened 7 months ago

loostrum commented 7 months ago

For the ultrasound part of the RECRUIT project I'd like to see if we can use cudawrappers, but their production system runs windows. I see no reason why cudawrappers shouldn't work on windows, but I haven't tried it. @csbnw have you ever tried it?

I can set up a windows machine at home to test if needed, I should still have an NVIDIA GPU lying around somewhere.

csbnw commented 7 months ago

We (at ASTRON) have never tried compiling and running cudawrappers on Windows. It is an interesting use-case, but to properly "support" this, we would also need to include Windows in the CI pipeline.

loostrum commented 7 months ago

Supporting it in the CI seems difficult. For my use case I'd be more than happy to have it as an experimental, no-promises-that-it-works feature, but I can also understand if you don't want such a non-supported feature.

In any case I'll see if I can get it to build on my Windows machine at home.

loostrum commented 6 months ago

The current code doesn't work as-is on windows, I thought I'd share my findings here:

The coverage and source embedding seem easy enough to fix, but I'm not sure what to do about the DeviceMemory constructor.

csbnw commented 6 months ago

The DeviceMemory constructor has the following signature:

explicit DeviceMemory(size_t size, CUmemorytype type = CU_MEMORYTYPE_DEVICE, unsigned int flags = 0)

How about removing the default value for the second parameter? It will however likely cause some existing code using this API to break.

loostrum commented 6 months ago

That does fix the issue, but is rather unfortunate. I quite like being able to do call cu::DeviceMemory(size) without having to specify the memory type. Calling DeviceMemory with a CUdeviceptr seems like the less used variant? If we could somehow change that one that might be better, although I'm not sure how we'd do that.