繁体   English   中英

Cudafy.Net System.ComponentModel.Win32Exception:系统找不到指定的文件

[英]Cudafy.Net System.ComponentModel.Win32Exception: The system cannot find the file specified

我在这里下载了 cudafy: https://github.com/lepoco/CUDAfy.NET/releases/tag/v.1.0.0 我使用 VS 2022,.NET 4.8。 执行此代码时,我得到 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);

堆栈跟踪:

   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

异常信息:

        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}

声明了 Path 环境变量:

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

Cuda Toolkit 11.6 已下载。

我能做些什么呢?

我通过连接源代码解决了这个问题。 特别是,该程序没有找到实用程序 vswhere.exe 的路径。 CUDA Toolkit 还需要 VS2010。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM