Attempt to create wrapper for CUDA Driver API

Hello! In my C# project I’m trying to write wrapper for Driver API

using System;
using System.Runtime.InteropServices;

namespace test
    public class DriverAPI
        private static extern int cuInit(uint flag);

        public static void CuInit(uint flag)
            int err = cuInit(flag);
            if (err != 0)

        static void Main()

but after running this code, I’m getting error 100:
* This indicates that no CUDA-capable devices were detected by the installed
* CUDA driver.

I don’t understand why, because I have 2 CUDA-capable devices on my computer with Windows 10

What happens if you run the cuda deviceQuery sample app? Does it show both GPUs?

yes, all other programs/tools indicates, that I have 2 GPUs

problem was solved by replacing DLLImport to [DllImport(@“nvcuda.dll”)], but I still not understand, why my 64bit application does not interact with “nvcuda64.dll” properly…