首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Cudafy.Net System.ComponentModel.Win32Exception:系统找不到指定的文件

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

Stack Overflow用户
提问于 2022-01-16 15:31:57
回答 1查看 89关注 0票数 1

我在这里下载了cudafy:https://github.com/lepoco/CUDAfy.NET/releases/tag/v.1.0.0。我使用VS 2022,.NET 4.8。在执行这段代码时,我得到了System.ComponentModel.Win32Exception。

代码语言:javascript
复制
            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:

代码语言:javascript
复制
   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

例外情况:

代码语言:javascript
复制
        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环境变量声明如下:

代码语言:javascript
复制
Path C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64

Cuda工具包11.6已经下载。

我能做些什么?

EN

回答 1

Stack Overflow用户

发布于 2022-01-19 10:13:37

我通过连接源代码解决了这个问题。特别是,程序找不到通往实用程序vswhere.exe的路径。此外,该数据自动化系统工具包需要VS2010。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70731539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档