Skip to content

Commit

Permalink
pci+linux: make 32bits domain warnings non-critical
Browse files Browse the repository at this point in the history
This issue seems to happen more frequently, don't report it unless
all errors are enabled.

This warning means that some PCI devices might be missing.
That's not critical enough to warn users (most of them know nothing about hwloc).
For the record, CUDA init warnings were demoted the same a couple releases ago.

Refs #354

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Jul 25, 2022
1 parent da32b89 commit 69fbc20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hwloc/topology-linux.c
Expand Up @@ -6820,7 +6820,7 @@ hwloc_linuxfs_pci_look_pcidevices(struct hwloc_backend *backend)
#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN
if (domain > 0xffff) {
static int warned = 0;
if (!warned && hwloc_hide_errors() < 2)
if (!warned && !hwloc_hide_errors())
fprintf(stderr, "hwloc/linux: Ignoring PCI device with non-16bit domain.\nPass --enable-32bits-pci-domain to configure to support such devices\n(warning: it would break the library ABI, don't enable unless really needed).\n");
warned = 1;
continue;
Expand Down
4 changes: 2 additions & 2 deletions hwloc/topology-pci.c
@@ -1,6 +1,6 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2021 Inria. All rights reserved.
* Copyright © 2009-2022 Inria. All rights reserved.
* Copyright © 2009-2011, 2013 Université Bordeaux
* Copyright © 2014-2018 Cisco Systems, Inc. All rights reserved.
* Copyright © 2015 Research Organization for Information Science
Expand Down Expand Up @@ -205,7 +205,7 @@ hwloc_look_pci(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus)
#ifndef HWLOC_HAVE_32BITS_PCI_DOMAIN
if (domain > 0xffff) {
static int warned = 0;
if (!warned && hwloc_hide_errors() < 2)
if (!warned && !hwloc_hide_errors())
fprintf(stderr, "hwloc/pci: Ignoring PCI device with non-16bit domain.\nPass --enable-32bits-pci-domain to configure to support such devices\n(warning: it would break the library ABI, don't enable unless really needed).\n");
warned = 1;
continue;
Expand Down

0 comments on commit 69fbc20

Please sign in to comment.