1

I downloaded cudafy here: https://github.com/lepoco/CUDAfy.NET/releases/tag/v.1.0.0. I use VS 2022, .NET 4.8. When executing this code, I get System.ComponentModel.Win32Exception.

            CudafyModes.Target = eGPUType.Cuda;
            CudafyModes.DeviceId = 0;
            CudafyTranslator.Language = CudafyModes.Target == eGPUType.OpenCL ? eLanguage.OpenCL : eLanguage.Cuda;

            if (CudafyHost.GetDeviceCount(CudafyModes.Target) == 0)
                throw new System.ArgumentException("No suitable devices found.", "original");

            GPGPU gpu = CudafyHost.GetDevice(CudafyModes.Target, CudafyModes.DeviceId);

            CudafyModule km = CudafyTranslator.Cudafy(); //THE EXCEPTION IS HERE
            gpu.LoadModule(km);

StackTrace:

   in System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   in Cudafy.NvccExe.getClExeDirectory()
   in Cudafy.CompilerHelper.Create(ePlatform platform, eArchitecture arch, eCudafyCompileMode mode, String workingDir, Boolean debugInfo)
   in Cudafy.Translator.CudafyTranslator.Cudafy()
   in Game.Position..ctor() in C:\Users\Lenovo\Desktop\simple\simple\Position.cs:line 464
   in Game.Position.StartPos() in C:\Users\Lenovo\Desktop\simple\simple\Position.cs:line 490
   in Game.Board..ctor() in C:\Users\Lenovo\Desktop\simple\simple\Board.cs:line 189
   in Game.FrmMain..ctor() in C:\Users\Lenovo\Desktop\simple\simple\FrmMain.cs:line 18
   in Game.Program.Main() in C:\Users\Lenovo\Desktop\simple\simple\Program.cs:line 19

Exception information:

        ErrorCode   -2147467259 int
        HResult -2147467259 int
        HelpLink    null    string
        InnerException  null
        NativeErrorCode 2   int
        Source  "System"    string
        TargetSite  {Boolean StartWithCreateProcess(System.Diagnostics.ProcessStartInfo)}   System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

The Path environment variable is declared:

Path C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64

Cuda Toolkit 11.6 has been downloaded.

What can I do about it?

MrOlegus
  • 5
  • 2

1 Answers1

0

I solved the problem by connecting the source code. In particular, the program did not find the path to the utility vswhere.exe. Also the CUDA Toolkit required VS2010.

MrOlegus
  • 5
  • 2