Skip to content

Commit

Permalink
hardcode npu1 for now (different pcie id)
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Aug 23, 2024
1 parent 9f2e389 commit 40b71be
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,21 @@ using Path = std::filesystem::path;
namespace {

FailureOr<std::string> getNPUVersion() {
std::string errorMessage;
auto maybeVbnv =
openInputFile("/sys/bus/pci/devices/0000:c5:00.1/vbnv", &errorMessage);
if (!maybeVbnv) {
llvm::errs() << "couldn't read pci info for npu because: " << errorMessage;
return failure();
}

std::string vbnv = std::string{maybeVbnv->getBuffer()};
std::regex rgx("RyzenAI-(.*)");
std::smatch matches;
if (std::regex_search(vbnv, matches, rgx)) return {matches[1]};
llvm::errs() << "couldn't find npu version in " << vbnv;
return failure();
// std::string errorMessage;
// auto maybeVbnv =
// openInputFile("/sys/bus/pci/devices/0000:c5:00.1/vbnv", &errorMessage);
// if (!maybeVbnv) {
// llvm::errs() << "couldn't read pci info for npu because: " << errorMessage;
// return failure();
// }
//
// std::string vbnv = std::string{maybeVbnv->getBuffer()};
// std::regex rgx("RyzenAI-(.*)");
// std::smatch matches;
// if (std::regex_search(vbnv, matches, rgx)) return {matches[1]};
// llvm::errs() << "couldn't find npu version in " << vbnv;
// return failure();
return std::string{"npu1"};
}

FailureOr<std::string> getTargetDir() {
Expand Down

0 comments on commit 40b71be

Please sign in to comment.