Skip to content

Update Python to 3.9 and most other packages as well #1811

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

Merged
merged 61 commits into from
Aug 14, 2022
Merged

Update Python to 3.9 and most other packages as well #1811

merged 61 commits into from
Aug 14, 2022

Conversation

akenmorris
Copy link
Contributor

@akenmorris akenmorris commented Jun 30, 2022

This PR upgrades Python to 3.9 and upgrades almost every package as far as possible.

In particular, we now use Qt from conda, so there is no need to install it anymore.

VTK from conda almost worked, but not quite, so we must still build it. ITK from conda is missing all the headers and was not usable.

happy with our version of the library.

Another option is to build VTK as a static library.  But I view that
as more of a last resort.
The results are slightly different but look roughly equivalent.  Some
implementation details must have changed in VTK.
Just slightly loosened the tolerance.
…ble with Python 3.9. It crashes at the end:

Thread 3063 "python" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ff8a4fa6700 (LWP 164162)]
0x000055555576e7aa in PyThreadState_Clear (tstate=0x7ffa6c000b90) at /usr/local/src/conda/python-3.9.13/Python/pystate.c:788
788	/usr/local/src/conda/python-3.9.13/Python/pystate.c: No such file or directory.
Missing separate debuginfos, use: zypper install libglib-2_0-0-debuginfo-2.62.6-3.6.1.x86_64 libglvnd-debuginfo-1.3.2-1.49.x86_64 libgthread-2_0-0-debuginfo-2.62.6-3.6.1.x86_64
(gdb) bt
    at /usr/local/src/conda/python-3.9.13/Python/pystate.c:788
   from /home/csafe/amorris/anaconda3/envs/py39/lib/python3.9/site-packages/torch/lib/libtorch_python.so
   from /home/csafe/amorris/anaconda3/envs/py39/lib/python3.9/site-packages/torch/lib/libtorch_python.so
   from /home/csafe/amorris/anaconda3/envs/py39/lib/python3.9/site-packages/torch/lib/libtorch_python.so
   from /home/csafe/amorris/anaconda3/envs/py39/lib/python3.9/site-packages/torch/lib/libtorch.so

Discussion here:

pytorch/pytorch#38228

deep_ssm --tiny_test works correclty with PyTorch 1.11.0
Only build VTK with EGL for linux
Running into this problem on linux container:

actions/checkout#760
@akenmorris
Copy link
Contributor Author

akenmorris commented Jul 1, 2022

Windows failing with this:

c:\bdeps\openvdb\build\openvdb\openvdb\instantiations\gridoperators.cc : fatal error C1002: compiler is out of heap space in pass 2 [C:\bdeps\openvdb\build\openvdb\openvdb\openvdb_shared.vcxproj]

@akenmorris
Copy link
Contributor Author

Linux (both) failing during build_dependencies.sh with this:

The hosted runner: GitHub Actions 6 lost communication with the server. Anything in your workflow that terminates the runner process, starves it for CPU/Memory, or blocks its network access can cause this error.
--

Downgrade libIGL until I can figure out their cmake changes
Downgrade boost to 1.74 to be compatible with VTK
Install gmock
Try building against VTK from conda
GHA is saying:

The hosted runner: GitHub Actions 5 lost communication with the server. Anything in your workflow that terminates the runner process, starves it for CPU/Memory, or blocks its network access can cause this error.
Apparently conda now has a libattr that /bin/tar from the container doesn't work with.
@akenmorris
Copy link
Contributor Author

Wow, OpenVDB has explicit instantiations that make the libraries >1GB each. This must have been the source of the MSVC compiler out of heap space and was a big contributor to the linux runners running out of disk space. The OpenVDB build dir was >4GB alone.

@akenmorris
Copy link
Contributor Author

akenmorris commented Jul 6, 2022

Mac OptimizeTests crashing here:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x7240e8f631c7)
  * frame #0: 0x00007240e8f631c7
    frame #1: 0x00007ff8118d0f1e libc++.1.dylib`std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(double) + 238
    frame #2: 0x000000010a48d152 libitkvnl-5.2.1.dylib`vnl_vector_fixed<double, 3u>::print(this=0x00007ff7bfefb718, s=0x00007ff7bfefb508) const at vnl_vector_fixed.hxx:151:14 [opt]
    frame #3: 0x000000010028a3dd OptimizeTests`std::__1::basic_ostream<char, std::__1::char_traits<char> >& operator<<<double, 3u>(ostr=0x00007ff7bfefb508, v=0x00007ff7bfefb718) at vnl_vector_fixed.h:900:5
    frame #4: 0x000000010028a311 OptimizeTests`shapeworks::Constraints::constraintsLagrangianGradient(this=0x0000600003710018, pos=0x00007ff7bfefb768, prepos=0x00007ff7bfefb930, C=1) at Constraints.cpp:509:22
    frame #5: 0x00000001005b4448 OptimizeTests`itk::ParticleGradientDescentPositionOptimizer<float, 3u>::AugmentedLagrangianConstraints(this=0x0000600003008870, gradient=0x00007ff7bfefb8f0, pt=0x00007ff7bfefb930, dom=0x00007ff7bfefb998, maximumUpdateAllowed=0x00007ff7bfefb960) at itkParticleGradientDescentPositionOptimizer.txx:264:29
    frame #6: 0x00000001005b3d77 OptimizeTests`itk::ParticleGradientDescentPositionOptimizer<float, 3u>::StartAdaptiveGaussSeidelOptimization(this=0x0000000119537d58, r=0x0000000119537d40)::'lambda'(tbb::detail::d1::blocked_range<unsigned long> const&)::operator()(tbb::detail::d1::blocked_range<unsigned long> const&) const at itkParticleGradientDescentPositionOptimizer.txx:159:17

Possibly related new warning:

warning: 'operator vnl_vector_ref' is deprecated: Implicit cast conversion is dangerous.

@akenmorris
Copy link
Contributor Author

akenmorris commented Jul 6, 2022

Windows failing with windeployqt:

2022-07-06T19:37:10.2444315Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: The command "setlocal [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2446913Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: C:\Miniconda3\envs\shapeworks\Library\bin\windeployqt.exe --verbose 5 -core -widgets -gui -sql -xml -printsupport --libdir C:/build/bin/Release C:/build/bin/Release/ShapeWorksStudio.exe [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2449277Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2451138Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmEnd [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2452953Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2454846Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmErrorLevel [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2456611Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: exit /b %1 [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2458324Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :cmDone [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2460244Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\build\Studio\src\ShapeWorksStudio.vcxproj]
2022-07-06T19:37:10.2461974Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :VCEnd" exited with code 1. [C:\build\Studio\src\ShapeWorksStudio.vcxproj]

Unbelievably, this is apparently just a documented bug with Qt 5.15.4, they somehow managed to publish a release where lconvert can't read their own translation files. Will be fixed in 5.15.5!

For now, it appears we can workaround by disabling translation, which we're not really using anyway.

https://bugreports.qt.io/browse/QTBUG-91558

@akenmorris
Copy link
Contributor Author

All builds working, binaries working out of the box. Need to double check Studio->Python integration on end user setups.

@akenmorris akenmorris changed the title Py39 test build Update Python to 3.9 and most other packages as well Aug 11, 2022
@akenmorris akenmorris marked this pull request as ready for review August 11, 2022 23:54
@akenmorris akenmorris merged commit d13f88d into master Aug 14, 2022
@akenmorris akenmorris deleted the py39 branch August 14, 2022 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant