[Bug 59556] New: GetSystemInfo returns host CPU count ignoring cgroup CPU limits inside containers (Yomawari: Lost in the Dark)
http://bugs.winehq.org/show_bug.cgi?id=59556 Bug ID: 59556 Summary: GetSystemInfo returns host CPU count ignoring cgroup CPU limits inside containers (Yomawari: Lost in the Dark) Product: Wine Version: 11.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@list.winehq.org Reporter: castaneai@castaneai.net Distribution: --- GetSystemInfo returns the host machine's full processor count (dwNumberOfProcessors) even when running inside a Linux container with cgroup CPU limits applied. For example, on a 16-core host with a container limited to 2 CPUs via "docker run --cpus=2", GetSystemInfo still reports 16 processors. Steps to reproduce: 1. Run Wine inside a Docker container with CPU limits: docker run --cpus=2 <wine-image> wine cmd /c "echo %NUMBER_OF_PROCESSORS%" 2. Observe that the reported processor count matches the host, not the cgroup limit. Expected results: The processor count should reflect the cgroup CPU limit (2 in this example), consistent with the behavior of `nproc` from GNU coreutils (version >= 9.8). Actual results: The processor count matches the host machine's total CPU count (e.g. 16). This affects applications that scale their behavior based on the reported processor count. Yomawari: Lost in the Dark (https://store.steampowered.com/app/1998330/), for instance, shows significant performance degradation when run in a CPU-limited container. Hot-patching GetSystemInfo to return the cgroup-limited CPU count resolved the issue, suggesting the game relies on this value to determine its thread count or workload distribution. Wine's `init_cpu_info()` in dlls/ntdll/unix/system.c uses `sysconf(_SC_NPROCESSORS_ONLN)`, which returns the host CPU count and does not account for cgroup v1/v2 CPU quotas (`cpu.max` / `cpu.cfs_quota_us`). GNU coreutils 9.8 (September 2025) added the same kind of cgroup v2 awareness to nproc: https://github.com/coreutils/coreutils/issues/108 Tested with Wine 11.5, Arch Linux, Docker with --cpus flag. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla