Repository: microsoft/onnxruntime
File: onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc (C++)

Code before:
      // The LUID is an 8-byte value, valid on Windows when luidDeviceNodeMask is non-zero.
      // We reconstruct the 64-bit integer representation from the raw bytes.
      if (prop.luidDeviceNodeMask == 0) {
        continue;
      }

      // Ensure the LUID is 8 bytes and reinterpret it directly as a uint64_t for comparison.
      static_assert(sizeof(prop.luid) == sizeof(uint64_t), "cudaDeviceProp::luid should be 8 bytes");
      uint64_t current_luid = *reinterpret_cast<const uint64_t*>(prop.luid);

      if (current_luid == target_luid) {
        // Ampere architecture or newer is required.
        return prop.major >= 8;
      }
    }

    return false;
#else
    const auto& metadata_entries = device.metadata.Entries();
    const auto it = metadata_entries.find("bus_id");
    if (it == metadata_entries.end()) {
      return false;
    }
    auto& target_id = it->second;
    int cuda_device_idx = 0;
    if (cudaSuccess != cudaDeviceGetByPCIBusId(&cuda_device_idx, target_id.c_str())) {
      return false;
    }

    cudaDeviceProp prop;
    if (cudaGetDeviceProperties(&prop, cuda_device_idx) != cudaSuccess) {
      return false;
    }
    // Ampere architecture or newer is required.
    return prop.major >= 8;
#endif
  }

  // Creates and returns OrtEpDevice instances for all OrtHardwareDevices that this factory supports.
  // An EP created with this factory is expected to be able to execute a model with *all* supported
  // hardware devices at once. A single instance of NvTensorRtRtx EP is not currently setup to partition a model among
  // multiple different NvTensorRtRtx backends at once (e.g, npu, cpu, gpu), so this factory instance is set to only
  // support one backend: gpu. To support a different backend, like npu, create a different factory instance
  // that only supports NPU.
  static OrtStatus* GetSupportedDevicesImpl(OrtEpFactory* this_ptr,
                                            const OrtHardwareDevice* const* devices,
                                            size_t num_devices,
                                            OrtEpDevice** ep_devices,
                                            size_t max_ep_devices,
                                            size_t* p_num_ep_devices) noexcept {
    size_t& num_ep_devices = *p_num_ep_devices;

Review comment (suggestion):
nit: for consistency
```suggestion
    if (cudaDeviceGetByPCIBusId(&cuda_device_idx, target_id.c_str()) != cudaSuccess) {
```

Code after:
    }

    for (int i = 0; i < device_count; ++i) {
      cudaDeviceProp prop;
      if (cudaGetDeviceProperties(&prop, i) != cudaSuccess) {
        continue;
      }

      // The LUID is an 8-byte value, valid on Windows when luidDeviceNodeMask is non-zero.
      // We reconstruct the 64-bit integer representation from the raw bytes.
      if (prop.luidDeviceNodeMask == 0) {
        continue;
      }

      // Ensure the LUID is 8 bytes and reinterpret it directly as a uint64_t for comparison.
      static_assert(sizeof(prop.luid) == sizeof(uint64_t), "cudaDeviceProp::luid should be 8 bytes");
      uint64_t current_luid = *reinterpret_cast<const uint64_t*>(prop.luid);

      if (current_luid == target_luid) {
        // Ampere architecture or newer is required.
        return prop.major >= 8;
      }
    }

    return false;
#else
    const auto& metadata_entries = device.metadata.Entries();
    const auto it = metadata_entries.find("pci_bus_id");
    if (it == metadata_entries.end()) {
      return false;
    }
    auto& target_id = it->second;
    int cuda_device_idx = 0;
    if (cudaDeviceGetByPCIBusId(&cuda_device_idx, target_id.c_str()) != cudaSuccess) {
      return false;
    }

    cudaDeviceProp prop;
    if (cudaGetDeviceProperties(&prop, cuda_device_idx) != cudaSuccess) {
      return false;
    }
    // Ampere architecture or newer is required.
    return prop.major >= 8;
#endif
  }

  // Creates and returns OrtEpDevice instances for all OrtHardwareDevices that this factory supports.
  // An EP created with this factory is expected to be able to execute a model with *all* supported
  // hardware devices at once. A single instance of NvTensorRtRtx EP is not currently setup to partition a model among
  // multiple different NvTensorRtRtx backends at once (e.g, npu, cpu, gpu), so this factory instance is set to only
  // support one backend: gpu. To support a different backend, like npu, create a different factory instance