简体   繁体   English

与NVIDA CUDA安装一起使用Intel OpenCL.dll

[英]Use Intel OpenCL.dll alongside a NVIDA CUDA installation

I have a computer that has an Intel CPU and an NVIDIA GPU, running Windows 7. I have a software module that is written in NVIDIA CUDA, and another module written in OpenCL. 我有一台装有Intel CPU和NVIDIA GPU的计算机,运行Windows7。我有一个用NVIDIA CUDA编写的软件模块,另一个是用OpenCL编写的模块。 I would like to run the OpenCL module on the CPU, using the Intel implementation of OpenCL, and at the same time, use the CUDA module. 我想使用Intel的OpenCL实现在CPU上运行OpenCL模块,同时使用CUDA模块。

In my system I installed first the CUDA SDK, and then the SDK from Intel. 在我的系统中,我先安装了CUDA SDK,然后安装了Intel的SDK。

I've compiled the program in Visual Studio 2012, instructing the linker to use the Intel's library (and I compiled against the OpenCL headers provided by intel). 我已经在Visual Studio 2012中编译了该程序,指示链接程序使用Intel的库(并且针对Intel提供的OpenCL标头进行了编译)。

However when I run a simple program to query the hardware I'm only able to see the NVIDIA card. 但是,当我运行一个简单的程序来查询硬件时,我只能看到NVIDIA卡。

I've tried modifying the Windows Registry, and the PATH variable, with no look. 我试着修改Windows注册表和PATH变量,没有任何外观。 When I query the dependencies with "Dependecy Walker" I see that the program depends on a dll located in c:\\windows\\system32, which is not the folder where the Intel dll is. 当我使用“ Dependecy Walker”查询依赖项时,我看到程序依赖于位于c:\\ windows \\ system32的dll,而不是Intel dll所在的文件夹。 I've tried deleting this dll but I still see this dependency, and I'm only able to access the GPU. 我尝试删除此dll,但仍然看到此依赖关系,并且只能访问GPU。

Any idea about what could be happening? 对可能发生的事情有任何想法吗?

On Windows, "OpenCL.dll" is the ICD provided by Khronos and redistributed by AMD, NVIDIA and Intel. 在Windows上,“ OpenCL.dll” Khronos提供并由AMD,NVIDIA和Intel重新分发的ICD。

The actual drivers are referenced by the Registry, and the ICD enumerates them all. 注册表会引用实际的驱动程序,而ICD会枚举所有这些驱动程序。

When you query the OpenCL platforms, you'll see one for each installed driver (AMD, NVIDIA, Intel). 查询OpenCL平台时,将为每个安装的驱动程序(AMD,NVIDIA,Intel)看到一个。

Within each platform there will be devices (or device), for example, in the NVIDIA platform you'll find your NVIDIA GPU and under the Intel platform you'll find your CPU. 在每个平台中都会有一个或多个设备,例如,在NVIDIA平台中,您将找到NVIDIA GPU;在Intel平台下,您将找到您的CPU。

Don't replace OpenCL.dll 不要替换OpenCL.dll

Run clinfo or GPU-Z to see what OpenCL platforms and devices it sees. 运行clinfo或GPU-Z以查看它所看到的OpenCL平台和设备。

Re-install the Intel CPU driver (a new one was just posted 2 days ago) to make sure their driver is installed. 重新安装Intel CPU驱动程序(两天前刚刚发布了一个新的),以确保已安装其驱动程序。

Note: Your CPU needs to have SSE 4.2 for the Intel CPU driver to work. 注意:您的CPU需要具有SSE 4.2,才能运行Intel CPU驱动程序。

You could try the Installable Client Driver (ICD) Loader . 您可以尝试可安装客户端驱动程序(ICD)加载程序 However, I have no experience if it works on Windows. 但是,如果在Windows上运行,我没有经验。

Or: 要么:

Since you don't want to use the GPU with OpenCL you can simply copy the Intel OpenCL.dll into your working directory. 由于您不想将GPU与OpenCL一起使用,因此只需将Intel OpenCL.dll复制到您的工作目录中即可。 The working directory is visited first when .dll s are loaded. 加载.dll时,将首先访问工作目录。 So, even if the Nvidia OpenCL.dll is installed into your windows/system32 directory the Intel library is found first and therefore loaded. 因此,即使将Nvidia OpenCL.dll安装到windows/system32目录中,也会首先找到并因此加载Intel库。 There may be better solutions maybe load the dll on demand as discussed here Dynamically load a function from a DLL but as a fast solution it should work. 可能有更好的解决方案,如此处所述,可以按需加载dll。 从DLL动态加载功能,但作为快速解决方案,它应该可以工作。

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

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