Migrating to SYCL
One-stop forum for getting assistance migrating your existing code to SYCL
46 Discussions

How to Run oneAPI Ported DPC++ Code on Nvidia GPU

-Light-
Novice
411 Views

Hello,

I recently ported a CUDA project to DPC++ using oneAPI and successfully ran it on an Intel GPU. Now, I would like to run the same project on an Nvidia GPU on Windows to compare performance. How can I achieve this?

I tried using the following code to target the Nvidia GPU, but it did not recognize the NVIDIA GeForce RTX 3060 on my computer.

The code is attached below.

 

std::vector<platform> platforms = platform::get_platforms();
for (const auto& plt : platforms) {
std::string platform_name = plt.get_info<info::platform::name>();
std::cout << "Platform: " << platform_name << std::endl;
std::vector<device> devices = plt.get_devices();
for (const auto& dev : devices) {
if (dev.is_gpu()) {
std::string device_name = dev.get_info<info::device::name>();
std::string device_vendor = dev.get_info<info::device::vendor>();
std::string driver_version = dev.get_info<info::device::driver_version>();
std::cout << " GPU Device: " << device_name << std::endl;
std::cout << " Vendor: " << device_vendor << std::endl;
std::cout << " Driver Version: " << driver_version << std::endl;
}
}
}

Thank you!

0 Kudos
0 Replies
Reply