Gentoo Archives: gentoo-user

From: Fernando Rodriguez <frodriguez.developer@×××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] OT: GCC 5 Offloading
Date: Tue, 15 Sep 2015 07:23:08
Message-Id: BLU436-SMTP228DB3DF2DBF1D72B38F72E8D5C0@phx.gbl
In Reply to: [gentoo-user] OT: GCC 5 Offloading by james
1 On Tuesday, September 15, 2015 3:11:37 AM james wrote:
2 > Fernando Rodriguez <frodriguez.developer <at> outlook.com> writes:
3 >
4 > > Do you know of any plans to enable offloading on the gentoo toolchain?
5 >
6 > NO, but I'm sure some devs are keenly aware of this feature in gcc-5.
7 >
8 >
9 > > I was able to build the offloading compiler using crossdev with a few hacks
10 > > and wrote an ebuild for Intel's simulator[2]. I will work on enabling the
11 > > host compiler tomorrow and may open a feature request and post patches
12 > > once I get it working. The changes needed to enable it on the host are
13 > > pretty trivial.
14 >
15 > Sorry Fernando, I just now saw this thread on an old thread. I think that
16 > 'sys-cluster/ceph' is where I'd like to test your spin on the gcc-5.
17 > Ceph has RDMA (RoCE) in the 0.94 branch (in portage). You are definately
18 > ahead of me on practical gcc-5 experiments with offloading and other
19 > new features.
20 >
21 > You did not list your second reference. Where I can I get/git your
22 > compiler and some brief suggestions on taking it for a test drive.
23 >
24 > I'm not much interested in the Intel simulator, atm. I like to test on
25 > old gear running gentoo:: borking is no big deal, if it happens.
26 > Other codes keen to test gcc-5 (offloading) on are Apache-mesos and
27 > Apache-spark and mesos-distcc.
28 >
29 > Also, per this doc [1] you can get your own gentoo overlay to put
30 > things up for wider experimentation, if you like.
31 >
32 > [1] https://wiki.gentoo.org/wiki/Project:Overlays/Dev_Guide
33 >
34 >
35 > Very cool, what you have done,
36 > James
37
38 The link was for the emulator ebuild[1]. I got distracted with other stuff and
39 didn't make the host compiler, will do it this week. I built the offloading
40 (accel) compiler as follows:
41
42 1. Use crossdev like when building a regular cross-compiler:
43
44 # crossdev -v -t x86_64-intelmicemul-linux-gnu #for intel MIC
45 or
46 # crossdev -v -t nvptx-none # for nvidia ptx
47
48 2. As soon as it start building the 1st stage, hit CTRL-C
49
50 3. cd to your crossdev overlay, create an eclass directory and copy the
51 attached eclass to it.
52
53 4. cd to the category directory for your compiler and delete the gcc symlink
54 and copy over the gcc directory from your portage tree.
55
56 5. delete all ebuild versions except the one you want to install and apply the
57 attached patch to it.
58
59 6. Emerge it with crossdev again, it should succeed. Technically you don't
60 need to build the whole thing so you can use crossdev options to just build
61 the compiler (I didn't try that).
62
63 This works for Intel MCI. For nvidia ptx you need to install nvptx-tools and
64 tell the compiler how to find it by adding this on line 800 of the eclass: --
65 with-build-time-tools=[install-nvptx-tools]/nvptx-none/bin --disable-sjlj-
66 exceptions --enable-newlib-io-long-long. I will patch crossdev to do it
67 automatically when I get time. I won't bother with an ebuild for nvptx-tools
68 cause I don't have a card to test and don't want to buy one.
69
70 For the host compiler, it just need one configure option so it can find the
71 offloading/accelerator compiler. I plan to add GCC_OFFLOAD_TARGETS to make.conf
72 and patch toolchain.eclass to add it to the configure command. It's not
73 something I'll want to put on an overlay because it affects the whole toolchain
74 so I'll just make it a patch and apply it to the toolchain.eclass on the
75 portage tree when I want to build a compiler.
76
77 I want to test with opencv stuff since I got an embedded project that will do a
78 lot of it. I'm hoping to use the emulator to get a good idea of how much can
79 be offloaded and if it's worth getting one of those.
80
81 [1] https://github.com/fernando-rodriguez/portage-overlay/tree/master/dev-util/intel-sde-external
82 [2] https://github.com/MentorEmbedded/nvptx-tools/
83
84
85 --
86 Fernando Rodriguez

Attachments

File name MIME type
toolchain-offload.eclass text/plain
gcc-micemul.patch text/x-patch

Replies

Subject Author
[gentoo-user] Re: OT: GCC 5 Offloading james <wireless@×××××××××××.com>