-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openlibm fenv changes broke CUDA #38427
Comments
Looks like the openlibm |
I believe the reason why we did this was because we wanted feature parity across all platforms, otherwise some math functions were not getting looked up properly across all platforms. @vtjnash do you remember why we did this? |
I don't know why. We added that code to openlibm so that the function was available on Windows. Not sure why, since it should be in the mingw crt https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-crt/misc/fesetenv.c |
The implementation of `fesetenv` cannot be portable, as the value of `FE_DFL_ENV` differs between platforms. On FreeBSD, it is a actual environment. With glibc however, it's a sentinel -1 handled in the implementation of its floating point functions. With openlibm based on FreeBSD's libm, it assumes `FE_DFL_ENV` to be an actual environment. That assumption breaks using code that was compiled against glibc, e.g., `libcuda`: ``` Thread 1 "julia-debug" received signal SIGSEGV, Segmentation fault. 0x00007ffff7b855d0 in fesetenv () from /home/tim/Julia/julia/build/release/usr/bin/../lib/libopenlibm.so (gdb) bt ``` This reverts commit 5a27b4c. Fixes JuliaLang/julia#38427.
I'm re-opening this as possibly related to #39462 |
On latest nightly as well as master +
USE_BINARYBUILDER_OPENLIBM=false
DEPS_GIT=openlibm
:Reverting JuliaMath/openlibm#213 by using
OPENLIBM_SHA1=878948d3dd6bc940f65582b8cae286a06d89ad81
(and changingrounding.jl
to look forfesetround
andfegetround
inlibjulia
again or bootstrap fails) fixes the issue. Reproduces with CUDA.jl'sexamples/vadd.jl
(requiring https://github.com/JuliaGPU/GPUCompiler.jl/pull/69/files for 1.6 compatibility).Feel free to transfer this issue to https://github.com/JuliaMath/openlibm; I opened it here because it ultimately manifests as CUDA.jl not working on latest nightly.
The text was updated successfully, but these errors were encountered: