3

Over ten years ago, there was a great question about the pros and cons of the CUDA Driver API vs Runtime API.

A lot of time has obviously passed, and I was wondering how much things have changed. The old question had a great answer about things that were problematic with the runtime API if you used multiple threads that interfaced with the API.

Is that still problematic? What do most folks writing code for GPUs use now? I'm just starting with CUDA and am wondering if I should prefer one API over the other. I am using multiple threads and contexts, if that makes a difference.

aggieNick02
  • 2,557
  • 2
  • 23
  • 36

1 Answers1

2

The old question had a great answer about things that were problematic with the runtime API if you used multiple threads that interfaced with the API.

Is that still problematic?

No. Thread safety for the runtime API was fixed when CUDA 4 was released

What do most folks writing code for GPUs use now?

An authoritative answer would require a survey of developer behaviour which perhaps no-one except NVIDIA will have performed, and I have never seen anything like that published.

I would guess the overwhelming majority use the runtime API. I would also guess the overwhelming major always used the runtime API. There are use cases where the driver API still make more sense, but as always those have been for using specific facilities not exposed by the runtime API. They are unrelated to thread safety,

talonmies
  • 70,661
  • 34
  • 192
  • 269
  • These are both helpful pieces of information. Definitely seems like, in addition to these areas, a lot has developed/changed in CUDA over the last 10 years. – aggieNick02 Jun 04 '20 at 22:52