[GHC] #15049: NUMA not detected on Win10 with AMD Ryzen Threadripper

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper --------------------------------------+--------------------------------- Reporter: kanetw | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Runtime System | Version: 8.4.1 Keywords: | Operating System: Windows Architecture: x86_64 (amd64) | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: --------------------------------------+--------------------------------- AMD's Threadripper can be configured to be a 1-socket 2-die NUMA system: Coreinfo.exe: {{{ Logical to Physical Processor Map: **------------------------------ Physical Processor 0 (Hyperthreaded) --**---------------------------- Physical Processor 1 (Hyperthreaded) ----**-------------------------- Physical Processor 2 (Hyperthreaded) ------**------------------------ Physical Processor 3 (Hyperthreaded) --------**---------------------- Physical Processor 4 (Hyperthreaded) ----------**-------------------- Physical Processor 5 (Hyperthreaded) ------------**------------------ Physical Processor 6 (Hyperthreaded) --------------**---------------- Physical Processor 7 (Hyperthreaded) ----------------**-------------- Physical Processor 8 (Hyperthreaded) ------------------**------------ Physical Processor 9 (Hyperthreaded) --------------------**---------- Physical Processor 10 (Hyperthreaded) ----------------------**-------- Physical Processor 11 (Hyperthreaded) ------------------------**------ Physical Processor 12 (Hyperthreaded) --------------------------**---- Physical Processor 13 (Hyperthreaded) ----------------------------**-- Physical Processor 14 (Hyperthreaded) ------------------------------** Physical Processor 15 (Hyperthreaded) Logical Processor to Socket Map: ******************************** Socket 0 Logical Processor to NUMA Node Map: ****************---------------- NUMA Node 0 ----------------**************** NUMA Node 1 Approximate Cross-NUMA Node Access Cost (relative to fastest): 00 01 00: 1.0 1.4 01: 1.7 1.2 }}} However, ghc-8.4.1 doesn't detect the NUMA topology when running with `--numa` {{{ ghc.EXE: --numa: OS reports NUMA is not available }}} I haven't attempted dualbooting into Linux, yet, so I can't tell whether it's a Windows-only issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15049 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper -----------------------------------+-------------------------------------- Reporter: kanetw | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Runtime System | Version: 8.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------------+-------------------------------------- Comment (by bgamari): Hmm, interesting. Note that on Linux NUMA support requires that the compiler be built with `libnumactl` support, which the provided binary distributions are not. However, this ought to just work on Windows. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15049#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper -----------------------------------+-------------------------------------- Reporter: kanetw | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Runtime System | Version: 8.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------------+-------------------------------------- Comment (by kanetw): I think I found the reason: win32/OSMem.c {{{ bool osNumaAvailable(void) { return osNumaNodes() > 1; } uint32_t osNumaNodes(void) { /* Cache the amount of NUMA values. */ static ULONG numNumaNodes = 0; /* Cache the amount of NUMA nodes. */ if (!numNumaNodes && !GetNumaHighestNodeNumber(&numNumaNodes)) { numNumaNodes = 1; } return numNumaNodes; } }}} Looks like a off by one. GetNumaHighestNodeNumber is 0 on non-NUMA systems, and >0 on NUMA systems, but osNumaAvailable() checks for >1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15049#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper -----------------------------------+-------------------------------------- Reporter: kanetw | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Runtime System | Version: 8.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------------+-------------------------------------- Comment (by kanetw): Also note that docs for GetNumaHighestNodeNumber state: "The number of the highest node is not guaranteed to be the total number of nodes." -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15049#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper -----------------------------------+-------------------------------------- Reporter: kanetw | Owner: kanetw Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Runtime System | Version: 8.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -----------------------------------+-------------------------------------- Changes (by kanetw): * owner: (none) => kanetw -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15049#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper -----------------------------------+-------------------------------------- Reporter: kanetw | Owner: kanetw Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Runtime System | Version: 8.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): D4607 Wiki Page: | -----------------------------------+-------------------------------------- Changes (by kanetw): * status: new => patch * differential: => D4607 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15049#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper -----------------------------------+-------------------------------------- Reporter: kanetw | Owner: kanetw Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Runtime System | Version: 8.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4607 Wiki Page: | -----------------------------------+-------------------------------------- Changes (by kanetw): * differential: D4607 => Phab:D4607 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15049#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper
-----------------------------------+--------------------------------------
Reporter: kanetw | Owner: kanetw
Type: bug | Status: patch
Priority: normal | Milestone: 8.6.1
Component: Runtime System | Version: 8.4.1
Resolution: | Keywords:
Operating System: Windows | Architecture: x86_64 (amd64)
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4607
Wiki Page: |
-----------------------------------+--------------------------------------
Comment (by Ben Gamari

#15049: NUMA not detected on Win10 with AMD Ryzen Threadripper -----------------------------------+-------------------------------------- Reporter: kanetw | Owner: kanetw Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Runtime System | Version: 8.4.1 Resolution: fixed | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4607 Wiki Page: | -----------------------------------+-------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15049#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC