Skip to content

AMD get_version crash #1779

@AidanBeltonS

Description

@AidanBeltonS

Describe the bug

When using get_device_info on the MI210 (and I suspect other AMD devices) the application crashes.
This is due to the parsing of the device name, to get the major and minor versions.

The underlying problem is the AMD name does not contain the version number that it is searching for.
AMD String: gfx90a:sramecc+:xnack-
NVidia String: 8.0
Intel String: 1.3

Error:

terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoi
Aborted
static void get_device_info(device_info &out, const sycl::device &dev) {
  device_info prop;
  prop.set_name(dev.get_info<sycl::info::device::name>().c_str());

  int major, minor;
  detail::get_version(dev, major, minor); -> error occurs here
  prop.set_major_version(major);
  prop.set_minor_version(minor);

To reproduce

Run this with an AMD GPU

#include <sycl/sycl.hpp>
#include <oneapi/mkl.hpp>

#include <dpct/dpct.hpp>
#include <dpct/blas_utils.hpp>

int main() {
    sycl::queue Q;

    dpct::device_info info;
    dpct::get_device_info(info, Q.get_device());
}

Environment

  • OS: Linux (probably also applies to Windows)
  • Device: AMD

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions