我想在Windows 10 Pro 21H2中使用SYCL在Nvidia GPU上进行工作负载19044.3086。SYCL指南指出,CUDA后端在Windows上受支持:
Build DPC++ toolchain with support for NVIDIA CUDA
To enable support for CUDA devices, follow the instructions... for Windows DPC++ toolchain
Note, the CUDA backend has Windows support
字符串
当在PowerShell中使用computecpp测试硬件支持时,我得到:
PS D:\repos\ComputeCpp\bin> .\computecpp_info.exe
********************************************************************************
SYCL 1.2.1 revision 3
********************************************************************************
Device Info:
Discovered 3 devices matching:
platform : <any>
device type : <any>
--------------------------------------------------------------------------------
Device 0:
Device is supported : UNTESTED - Vendor not tested on this OS
Bitcode targets : spirv64 ptx64
CL_DEVICE_NAME : NVIDIA GeForce RTX 3060 Laptop GPU
CL_DEVICE_VENDOR : NVIDIA Corporation
CL_DRIVER_VERSION : 535.98
CL_DEVICE_TYPE : CL_DEVICE_TYPE_GPU
--------------------------------------------------------------------------------
Device 1:
Device is supported : UNTESTED - Device running untested driver
CL_DEVICE_NAME : AMD Ryzen 5 5600H with Radeon Graphics
--------------------------------------------------------------------------------
Device 2:
Device is supported : UNTESTED - Device not tested on this OS
CL_DEVICE_NAME : Intel(R) FPGA Emulation Device
型
然而,使用oneAPI DPC++编译器2023检查Visual Studio 2022中的可用平台,我没有得到GPU,只有CPU和FPGA仿真器:
Found platform: Intel(R) FPGA Emulation Platform for OpenCL(TM)
Device: Intel(R) FPGA Emulation Device
Found platform: Intel(R) OpenCL
Device: AMD Ryzen 5 5600H with Radeon Graphics
型
用于此的代码:
#include <sycl/sycl.hpp>
#include <iostream>
#if FPGA || FPGA_EMULATOR
#include <sycl/ext/intel/fpga_extensions.hpp>
#endif
using namespace sycl;
int main(int argc, char* argv[]) {
// Loop through available platforms
for (auto const& this_platform : platform::get_platforms()) {
std::cout << "Found platform: "
<< this_platform.get_info<info::platform::name>() << "\n";
// Loop through available devices in this platform
for (auto const& this_device : this_platform.get_devices()) {
std::cout << " Device: "
<< this_device.get_info<info::device::name>() << "\n";
}
std::cout << "\n";
}
return 0;
}
型
我也安装了CUDA 12.2,可以在VS2022中运行CUDA项目。为什么在DPC++项目中找不到GPU(发布和调试模式)?我应该怎么做来修复它?
1条答案
按热度按时间kuuvgm7e1#
如果你使用的是Linux,你可以使用英特尔的DPC版本的Codeplay's OneAPI for NVidia GPUs插件。这还没有在Windows上发布。
要针对Windows上的NVidia GPU,您需要使用适当的标志从源代码构建开源DPC。有关如何做到这一点的文档可在英特尔/llvm存储库中找到。
构建并安装后,您可以使用
sycl-ls
(或sycl-ls --verbose
以获取更多详细信息)测试是否正确找到NVidia设备。至于为什么你会看到带有computecpp_info.exe的CUDA设备:ComputeCpp独立于DPC++。只有当你使用ComputeCpp作为SYCL编译器时,你才应该使用computecpp_info. exe。然而,Codeplay指出,ComputeCpp的CUDA支持已经在2020年被DPC++的CUDA支持超级种子,并且自9月1日起不再支持ComputeCpp。