Would like to understand how to write programs integrating CUDA and CLR

What I’m asking about is how do I conceptually approach the issue of writing a program that “kind of easily” integrates CUDA processing with actual managed code (in Windows this would perhaps take the form of C# over CLR). I’m well aware there exist GIT projects with names like “ManagedCUDA” but there doesn’t really appear to be much in the way of any real strategic approach, and as far as I can tell when I try to find any books that might actually describe a systems approach to solving this both worldcat.org and amazon.com really haven’t found any relevant titles. Also I’m hoping to be able to tie into existing Windows audio streams, I’m thinking this is probably going to mean that the processing will need to be (don’t laugh yet) actually pretty “synchronous”, or perhaps I will need to create a separate input and output streams that are isolated from Windows that someone could link to from outside. (Now I understand someone may think people who write code to do audio “aren’t all there”, for those who think that please understand a long time ago I was granted a US patent for a software algorithm for audio processing, now I’m FINALLY finding the HW and toolsets that will allow this algorithm to serve a useful purpose, but I just need to implement a practical implementation and so I need a little help.) Can anyone help me how to proceed to do this? Thank you so much for your help!

1 Like

Not sure why anyone would think that. Just a couple years ago there were these folks presenting at a GPU Technology Conference:

NVIDIA also has an audio processing application of their own. I haven’t used it, it may be more of a technology demonstration with limited functionality:

I seem to recall that there were other audio efforts over the past decade and a few related threads in this forum. Whether any of them resulted in actual shipping products I do not know. Depending on what you do anticipated issues may be lack of inherent parallelism as well as latency and jitter challenges.

The name ManagedCUDA rings a bell, and I am aware that various people have tried to integrate CUDA with C# and the like, but I don’t have any useful pointers at hand. Other forum participants may have deeper insights.

I can show specifically that the Microsoft “side of the house” doesn’t take audio seriously, just look at the async way they force you to deal with streams! I’m glad to hear that Nvidia takes audio more seriously and apparently is actively developing some useful technology. Anyway I certainly “meant no offense” and if anyone can contribute to my learning a structured way to handle this type of situation I’m definitely eager to hear about it.

OK, so the lack of replies here kind of indicates there aren’t many voices here who have the information that I happen to be seeking. I guess at some level I still have a couple more options, I guess I could (at some inconvenience) abandon Windows and write a program that runs under Linux (I’m not all that familiar with all the GUI libraries right now, but I guess all that could be overcome), or perhaps I could find a way to interface directly to the audio driver and just “bypass” most of the OS entirely (although that would probably seriously restrict the universality of the example code deployment). Can anyone suggest some meaningful resources that I could study in order to accomplish my goal in either of those ways? Thank you very much in advance.

There are quite a few options for C# development with CUDA/GPU. I won’t be able to curate them for you, I have no experience with them. None of them are directly provided by or supported by NVIDIA. Here is a non-exhaustive list, you will probably need to do google searches if these are not something you have already come across. Some, perhaps most, may be moribund/deprecated:

  1. managedCuda
  2. cudafy
  3. Altimesh Hybridizer
  4. ILGPU
  5. computesharp
  6. cudaSharper
  7. cudaSharp
  8. tidepowered GPU dot Net
  9. aleaGPU
  10. C++ AMP
  11. All the options that exist to combine unmanaged code with managed code including DLL methods and P/Invoke

I would agree there does not seem to be one overarching method or “strategy” that people use with managed code, thus the plethora of things people have created above. But you could probably make similar statements about development in a native C++ or python environment, for example. There are different tool chains, with different levels of abstraction, meeting different needs.

Anyway, if what you’re asking is how to output audio in a modern system, I agree that this forum is probably not a target rich environment to get a lot of great feedback on that.

CUDA and audio plumbing in a modern OS are pretty much orthogonal. If you know how to deliver audio in a managed environment, you can use CUDA to create the data/samples for that. If you don’t know how to deliver audio in a managed environment (or indeed in whatever environment you choose or end up with) this particular sub-forum is probably not the best place to get advice about that.

1 Like

OK if I could be allowed to “simplify” a bit, maybe for current purposes I could try and “define” a managed environment as an ability to properly utilize the facilities of the Common Language Runtime. If I do that the “most recent” current attempt to authoritatively document that is probably Richter’s book for Microsoft Press back in 2012, but it’s pretty unlikely that a document that’s a dozen years old in a dynamic environment like that would remain very “authoritative”. I can find half a dozen others but my efforts to find either a paper copy or active link to an e-book have proved fruitless, and certainly I need to at least see “audio streams” in the index if I intend to spend any time studying it. And is there some other forum here I’m actually allowed to post in where I could learn a bit about either of the “corporate” audio projects mentioned above, or at least get more information about how I would set about creating an architecture useful to my purpose? After all I’m willing to create and write my own code, I didn’t get awarded a US patent by not being willing to get involved deeply into issues of technical detail, I’m just attempting to get it implemented now and learn how to use the tools customarily provided that will empower me to do so.

I won’t be able to help with questions about CLR, locating books about CLR, finding books that mention audio streams, or how to handle audio streams in CLR. None of those items have anything at all to do with CUDA programming. This sub-forum is not about any of those items.

Our developer forums are arranged like an inverted tree. You should be able to post in almost any of them. The tree is arranged hierarchically to ease with browsing. You can go to the top of the tree here to start browsing if you wish. I don’t have any suggestions for audio forums, or CLR forums. I’m not aware that we have any forums that cover those topics.

One of those is a GTC presentation from another company. I think you will be unlikely to easily connect with that other company via NVIDIA developer forums. Of course, you can start your learning by reviewing the GTC content at that link.

The other item is a consumer/GeForce/Studio feature (Broadcast App). We have GeForce (and Studio) forums (they are not developer forums, per-se) available here. I don’t know if any of that will be an effective means for you. But you can ask questions about the broadcast app (that item/topic) and possibly get useful answers. The broadcast app does/can do audio processing, but its definitely about much more than that.

Wowzer! Just figured out that the key phrase I OUGHT to have been looking for is something called Windows Media Foundation, and that even discussion of this matter has become SO complex and toxic that even Microsoft apparently “threw in the towel” and allowed a worked example of this to appear twice, once as an inexpensive book for sale on Amazon (“Windows Media Foundation: Getting Started in C#: A Step-by-step Guide to Writing Windows Media Foundation Applications in C#”), or you can just download the PDF of the book at http://www.ofitselfso.com/Tanta/Windows_Media_Foundation_Getting_Started_CSharp.pdf .

See, occasionally perseverence actually pays off!!

1 Like

Great to hear you are making forward progress.

In my experience, it almost always pays off. There are projects that I have pursued, on and off, for over 20 years, and every few years I am able to move forward another step.

1 Like