Adding AVX support libdeal.ii debian 12 package

76 views
Skip to first unread message

Gregory Christian

unread,
Aug 14, 2024, 9:15:59 AM8/14/24
to deal.II User Group
Hi all, 

I'm trying to add AVX2 support for step-76 but have had no luck.
Steps taken:
sudo apt source libdeal.ii-dev
sudo chown -R $USER:$USER deal.ii-9.4.1
modify the debian/rules -DDEAL_II_CXX_FLAGS to include -march=skylake (I have an i7 6700)
Then build and install using debuild
Problem:
The package builds and installs just fine but step-76 is still running unoptimized, is there something I should change?
Kind Regards,
Greg

Daniel Arndt

unread,
Aug 14, 2024, 10:11:44 AM8/14/24
to dea...@googlegroups.com
Greg,

What does your detailed.log look like? The "Vectorization level" line
should tell you the detected capabilities.

Best,
Daniel
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/126b4374-94f1-4df7-ab5c-040898681994n%40googlegroups.com.

Gregory Christian

unread,
Aug 14, 2024, 10:43:18 AM8/14/24
to deal.II User Group
Hi Daniel,

The output is Vectorization over 1 doubles = 64 bits (disabled)

Kind Regards,
Greg

Daniel Arndt

unread,
Aug 14, 2024, 10:55:18 AM8/14/24
to dea...@googlegroups.com
Did you actually reconfigure and recompile deal.II itself or only step-76?
You should see in the CMake configuration output why AVX-support
wasn't detected.\

Best,
Daniel

On Wed, Aug 14, 2024 at 8:43 AM Gregory Christian
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/b07f94a1-1aaa-47e9-bf69-d9eb3290b69en%40googlegroups.com.

Gregory Christian

unread,
Aug 14, 2024, 11:16:43 AM8/14/24
to dea...@googlegroups.com
Dear Daniel,

Yes I reconfigured (only changing the debian/rules) file and recompiled dealii, not just step-76. I checked the linkers whilst the package was compiling and -march=skylake was present throughout.
Kind regards,
Greg

Wolfgang Bangerth

unread,
Aug 14, 2024, 12:10:20 PM8/14/24
to dea...@googlegroups.com
On 8/14/24 09:16, Gregory Christian wrote:
>
> Yes I reconfigured (only changing the debian/rules) file and recompiled
> dealii, not just step-76. I checked the linkers whilst the package was
> compiling and -march=skylake was present throughout.

This isn't my area of expertise, but did you se
-DDEAL_II_ALLOW_PLATFORM_INTROSPECTION=ON when calling cmake?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Daniel Arndt

unread,
Aug 14, 2024, 1:22:17 PM8/14/24
to dea...@googlegroups.com
I am seeing something like

-- Include /tmp/dealii_new/cmake/checks/check_01_cpu_features.cmake
-- Performing Test DEAL_II_HAVE_SSE2
-- Performing Test DEAL_II_HAVE_SSE2 - Failed
-- Performing Test DEAL_II_HAVE_AVX
-- Performing Test DEAL_II_HAVE_AVX - Failed
-- Performing Test DEAL_II_HAVE_AVX512
-- Performing Test DEAL_II_HAVE_AVX512 - Failed
-- Performing Test DEAL_II_HAVE_ALTIVEC
-- Performing Test DEAL_II_HAVE_ALTIVEC - Failed
-- Performing Test DEAL_II_HAVE_ARM_NEON
-- Performing Test DEAL_II_HAVE_ARM_NEON - Success
-- Performing Test DEAL_II_HAVE_OPENMP_SIMD
-- Performing Test DEAL_II_HAVE_OPENMP_SIMD - Success

when configuring deaI.II. What does that look like for you? You can
then have a look at CMakeFiles/CMakeConfigureLog.yaml to understand
why certain checks fail (including the compile line used).

Best,.
Daniel
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/bdb37a5e-e88d-49f9-b1ff-c957ad72d10e%40colostate.edu.

Matthias Maier

unread,
Aug 14, 2024, 3:57:04 PM8/14/24
to dea...@googlegroups.com
Yes,

You'll need to flip that option to on.

Best,
Matthias

Gregory Christian

unread,
Aug 15, 2024, 1:27:17 PM8/15/24
to deal.II User Group
Hi,
Dealii does recognise AVX compatibility and all the quick tests pass however I encounter the following error when trying to run step-76
:./examples/step-76/step-76.cc:511: error: undefined reference to 'dealii::MatrixFree<2, double, dealii::VectorizedArray<double, 4ul> >::MatrixFree()'
/usr/include/deal.II/matrix_free/operators.h:1141: error: undefined reference to 'dealii::internal::CellwiseInverseMassFactory<2, dealii::VectorizedArray<double, 4ul> >::transform_from_q_points_to_basis(unsigned int, dealii::FEEvaluationData<2, dealii::VectorizedArray<double, 4ul>, false> const&, dealii::VectorizedArray<double, 4ul> const*, dealii::VectorizedArray<double, 4ul>*)'
/usr/include/deal.II/matrix_free/matrix_free.h:3247: error: undefined reference to 'void dealii::MatrixFree<2, double, dealii::VectorizedArray<double, 4ul> >::internal_reinit<double, 2>(std::shared_ptr<dealii::hp::MappingCollection<2, 2> > const&, std::vector<dealii::DoFHandler<2, 2> const*, std::allocator<dealii::DoFHandler<2, 2> const*> > const&, std::vector<dealii::AffineConstraints<double> const*, std::allocator<dealii::AffineConstraints<double> const*> > const&, std::vector<dealii::IndexSet, std::allocator<dealii::IndexSet> > const&, std::vector<dealii::hp::QCollection<2>, std::allocator<dealii::hp::QCollection<2> > > const&, dealii::MatrixFree<2, double, dealii::VectorizedArray<double, 4ul> >::AdditionalData const&)'
/usr/include/deal.II/matrix_free/fe_evaluation.h:4231: error: undefined reference to 'dealii::internal::FEEvaluationHangingNodesFactory<2, double, dealii::VectorizedArray<double, 4ul> >::apply(unsigned int, unsigned int, dealii::internal::MatrixFreeFunctions::ShapeInfo<dealii::VectorizedArray<double, 4ul> > const&, bool, std::array<unsigned char, 4ul> const&, dealii::VectorizedArray<double, 4ul>*)'
/usr/include/deal.II/matrix_free/fe_evaluation.h:4231: error: undefined reference to 'dealii::internal::FEEvaluationHangingNodesFactory<2, double, dealii::VectorizedArray<double, 4ul> >::apply(unsigned int, unsigned int, dealii::internal::MatrixFreeFunctions::ShapeInfo<dealii::VectorizedArray<double, 4ul> > const&, bool, std::array<unsigned char, 4ul> const&, dealii::VectorizedArray<double, 4ul>*)'
/usr/include/deal.II/matrix_free/matrix_free.h:4752: error: undefined reference to 'dealii::MatrixFree<2, double, dealii::VectorizedArray<double, 4ul> >::create_cell_subrange_hp_by_index(std::pair<unsigned int, unsigned int> const&, unsigned int, unsigned int) const'
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/step-76.dir/build.make:298: step-76] Error 1
make[2]: *** [CMakeFiles/Makefile2:90: CMakeFiles/step-76.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/run.dir/rule] Error 2
make: *** [Makefile:137: run] Error 2
Kind Regards,
Greg

Gregory Christian

unread,
Aug 15, 2024, 1:27:19 PM8/15/24
to deal.II User Group
Nvm it worked, thank you! Although sudo apt install did not like installing the source version.
Kind Regards, 
Greg 

On Wednesday 14 August 2024 at 20:57:04 UTC+1 Matthias Maier wrote:
Reply all
Reply to author
Forward
0 new messages