0

Hello I need to retrieve the cuda version whether its cuda8 or cuda9.

anyone know a way I could tell?

I heard cuda managed would tell me but all it did was tell me the driver version "361.xx"

talonmies
  • 70,661
  • 34
  • 192
  • 269
Ragekilln
  • 1
  • 2
  • What API wrappers are you using to access CUDA from C#? Managed CUDA? – talonmies Apr 06 '18 at 05:18
  • i was using https://kunzmi.github.io/managedCuda/ – Ragekilln Apr 06 '18 at 05:20
  • You may want to have an eye on the source code of deviceQuery in Cuda samples as they appear to print it out. – Florent DUGUET Apr 06 '18 at 17:26
  • The method [here](https://github.com/kunzmi/managedCuda/blob/master/ManagedCUDA/CudaContext.cs#L5344) should give you what you are asking for. – Robert Crovella Apr 06 '18 at 19:02
  • @RobertCrovella: That method only returns the driver version because ManagedCUDA is a driver API wrapper – talonmies Apr 09 '18 at 09:03
  • @talonmies, I don't believe that is correct. I have run the underlying driver API call that that method uses, specifically [`cuDriverGetVersion()`](http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__VERSION.html#group__CUDA__VERSION_1g8b7a10395392e049006e61bcdc8ebe71) and it returns an integer of 9010 on a CUDA 9.1 system. This is consistent with the use of "CUDA driver version" terminology, and the same number that is returned by the `deviceQuery` app in the corresponding field. It's true I have not tested this in `managedCuda`, but I don't know why it would be different. – Robert Crovella Apr 09 '18 at 13:54

1 Answers1

1

Given you are using Managed CUDA, you can't.

Managed CUDA (and most other frameworks for using CUDA APIs in other languages like JCUDA and PyCUDA) use the CUDA driver API. There is no concept of "CUDA version" in the driver API, that is strictly a feature of the runtime API. As a result, you can't get the runtime API version with the driver API.

The only relevant version in the driver API is the driver version, which you already have found out how to access.

talonmies
  • 70,661
  • 34
  • 192
  • 269