I'm currently writing a HIP equivalent to NVIDIA's deviceQuery sample code. I want my code to work on both AMD and NVIDIA hardware.
Now, hipDeviceProp_t
isn't exactly the same as cudaDeviceProp_t
, because the former has both new and missing fields in the struct compared to the latter.
Currently the code I wrote works on AMD GPUs only and segfaults when I try it on an NVIDIA GPU, which I believe is due to accessing fields that are nonexistent in cudaDeviceProp_t
. It is also still missing a critical part to detect the exact GPU model within the same gfx???
GCN architecture code.
How do I figure out whether the detected GPU is AMD or NVIDIA?
Edit: for comparison, SYCL has sycl::info::device::vendor
that provides this information.