Skip to content

Tests fail using NVIDIA HPC compilers (PGI compilers) #3028

Description

@olupton

The fmt test suite does not pass using the 22.3 NVIDIA HPC compilers. I tested this with today's master (682e097) and confirmed I could reproduce using NVIDIA's own Docker images that ship their compilers:

$ docker run -it nvcr.io/nvidia/nvhpc:22.3-devel-cuda11.6-ubuntu20.04
root@411ece11247c:~# git clone https://github.com/fmtlib/fmt.git
Cloning into 'fmt'...
...
root@411ece11247c:~# cd fmt/
root@411ece11247c:~/fmt# mkdir build
root@411ece11247c:~/fmt# cd build
root@411ece11247c:~/fmt/build# cmake .. -DCMAKE_CXX_FLAGS="-tp haswell"
-- CMake version: 3.16.3
-- The CXX compiler identification is PGI 22.3.0
-- Check for working CXX compiler: /opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/bin/nvc++
-- Check for working CXX compiler: /opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/bin/nvc++ — works
…
root@411ece11247c:~/fmt/build# make
Scanning dependencies of target fmt
[  1%] Building CXX object CMakeFiles/fmt.dir/src/format.cc.o
…
(there are some warnings here)
root@411ece11247c:~/fmt/build# make test
Running tests...
Test project /root/fmt/build
      Start  1: args-test
 1/20 Test  #1: args-test ........................   Passed    0.01 sec
…
80% tests passed, 4 tests failed out of 20

Total Test time (real) =   0.22 sec

The following tests FAILED:
	  3 - chrono-test (Failed)
	  7 - format-test (Failed)
	 12 - printf-test (Failed)
	 17 - xchar-test (Failed)
Errors while running CTest
make: *** [Makefile:97: test] Error 8

(I had to add -DCMAKE_CXX_FLAGS="-tp haswell" because these compilers use the equivalent of -march=native by default, but they seem to mis-detect the AVX512 capabilities of my Ice Lake laptop CPU and produce binaries that fail with illegal instruction errors. This might not be needed on other systems.)

I checked 22.3 first because this is the version we currently use in production. I also checked the latest version, 22.7, using the nvcr.io/nvidia/nvhpc:22.7-devel-cuda11.7-ubuntu22.04 Docker image and see the same four tests failing.

If I additionally pass -DCMAKE_BUILD_TYPE=Debug then the printf-test test passes but the other three still fail.

In the debug build the format_test.precision test appears to fail when handling very small/denormal double values, while chrono_test.special_durations and format_test.format_nan have some mismatches between inf and nan. xchar_test.escape_string ends up with an extra backslash.

In the default (non-debug) build there are additional failures in printf_test.pointer, xchar_test.format, xchar_test.format_utf8_precision, xchar_test.format_to, xchar_test.join, xchar_test.streamed, xchar_test.chrono,
xchar_test.ostream, format_test.wide_format_to_n, chrono_test.time_point, locale_test.wformat and locale_test.chrono_weekday (list derived from the build with 22.7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions