open-mpi / hwloc

Hardware locality (hwloc)
https://www.open-mpi.org/projects/hwloc
Other
577 stars 174 forks source link

Black lstopo window #626

Closed rubin55 closed 4 months ago

rubin55 commented 1 year ago

What version of hwloc are you using?

# lstopo --version
lstopo 2.9.1

Which operating system and hardware are you running on?

# uname -a
Linux ORION 6.5.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 10 Oct 2023 21:10:21 +0000 x86_64 GNU/Linux
# lstopo -
Machine (126GB total)
  Package L#0
    NUMANode L#0 (P#0 126GB)
    L3 L#0 (16MB)
      L2 L#0 (512KB) + L1d L#0 (32KB) + L1i L#0 (32KB) + Core L#0
        PU L#0 (P#0)
        PU L#1 (P#8)
      L2 L#1 (512KB) + L1d L#1 (32KB) + L1i L#1 (32KB) + Core L#1
        PU L#2 (P#1)
        PU L#3 (P#9)
      L2 L#2 (512KB) + L1d L#2 (32KB) + L1i L#2 (32KB) + Core L#2
        PU L#4 (P#2)
        PU L#5 (P#10)
      L2 L#3 (512KB) + L1d L#3 (32KB) + L1i L#3 (32KB) + Core L#3
        PU L#6 (P#3)
        PU L#7 (P#11)
    L3 L#1 (16MB)
      L2 L#4 (512KB) + L1d L#4 (32KB) + L1i L#4 (32KB) + Core L#4
        PU L#8 (P#4)
        PU L#9 (P#12)
      L2 L#5 (512KB) + L1d L#5 (32KB) + L1i L#5 (32KB) + Core L#5
        PU L#10 (P#5)
        PU L#11 (P#13)
      L2 L#6 (512KB) + L1d L#6 (32KB) + L1i L#6 (32KB) + Core L#6
        PU L#12 (P#6)
        PU L#13 (P#14)
      L2 L#7 (512KB) + L1d L#7 (32KB) + L1i L#7 (32KB) + Core L#7
        PU L#14 (P#7)
        PU L#15 (P#15)
  HostBridge
    PCIBridge
      PCI 01:00.0 (NVMExp)
        Block(Disk) "nvme0n1"
    PCIBridge
      PCI 02:00.1 (SATA)
        Block(Disk) "sdd"
        Block(Disk) "sdb"
        Block(Disk) "sdc"
        Block(Disk) "sda"
      PCIBridge
        PCIBridge
          PCI 04:00.0 (Ethernet)
            Net "eth0"
    PCIBridge
      PCIBridge
        PCIBridge
          PCI 0a:00.0 (VGA)
  Misc(MemoryModule)
  Misc(MemoryModule)
  Misc(MemoryModule)
  Misc(MemoryModule)

Details of the problem

Running lstopo produces a black window, see screenshot: lstopo-black-window

I simply run lstopo from the commandline.

It displays a black window instead of the GL-based overview of my system.

bgoglin commented 1 year ago

Oh, that's interesting. Random things to test:

rubin55 commented 1 year ago

Thanks for the pointers, here goes:

Fwiw, I tested on three machines (all running the same version and same OS/kernel, two with AMD Radeon cards, one with Intel graphics). The radeons both display fully black screens, the intel displays this: lstopo-black-window-intel

bgoglin commented 1 year ago

What cairo version do you have? Do you know if things worked better on these systems in the past?

rubin55 commented 1 year ago

These systems use cairo 1.18.0 currently. I do know that these systems all had lstopo working normally before.

bgoglin commented 1 year ago

Thanks, ok I am going to upgrade my cairo on several systems to try to reproduce.

bgoglin commented 1 year ago

In the meantime, you could try to comment-out this line in the source since it sets the drawing color to black. We're supposed to only draw the border of the box with this color, but maybe we end up filling the box some reason.

--- a/utils/lstopo/lstopo-cairo.c
+++ b/utils/lstopo/lstopo-cairo.c
@@ -73,7 +73,7 @@ topo_cairo_box(struct lstopo_output *loutput, const struct lstopo_color *lcolor,
   cairo_fill(c);

   cairo_rectangle(c, x, y, width, height);
-  cairo_set_source_rgb(c, 0, 0, 0);
+//  cairo_set_source_rgb(c, 0, 0, 0);

   if (cpukind_style) {
     double dash = (double)(1U << cpukind_style);

Boxes won't have border anymore, but hopefully they'll have the expected background.

Another random patch to try is this one in case your compiler decides to cast to float after dividing:

--- a/utils/lstopo/lstopo-cairo.c
+++ b/utils/lstopo/lstopo-cairo.c
@@ -69,7 +69,7 @@ topo_cairo_box(struct lstopo_output *loutput, const struct lstopo_color *lcolor,
   int r = lcolor->r, g = lcolor->g, b = lcolor->b;

   cairo_rectangle(c, x, y, width, height);
-  cairo_set_source_rgb(c, (float)r / 255, (float) g / 255, (float) b / 255);
+  cairo_set_source_rgb(c, ((float)r) / 255, ((float)g) / 255, ((float)b) / 255);
   cairo_fill(c);

   cairo_rectangle(c, x, y, width, height);
bgoglin commented 5 months ago

Hello, did you have a chance to test the ideas above?

rubin55 commented 4 months ago

Hi, I'm sorry, I couldn't reproduce this after a random pacman -Syu; I didn't run into the issue again :/.

bgoglin commented 4 months ago

Thank you for replying. I am going to close, and hopefully you won't ever face the issue anymore. Otherwise feel free to reopen.