Summary: | media-libs/mesa-9.1_rc1[r600-llvm-compiler] and media-libs/mesa-9.1_rc1[video_cards_radeonsi] require changes to sys-devel/llvm-3.2 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Patrick Lauer <patrick> |
Component: | New packages | Assignee: | Gentoo X packagers <x11> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | 1i5t5.duncan, chris+gentoo-bugzilla, eugene.shalygin, gentoo, ivanhoe, kamensky.fb, matrix47, mgorny, mmk, orzel, ota, paolo.pedroni, pud, vityokster, voyageur, zeekec |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | llvm-r600-3.2_pre20121031.ebuild |
Description
Patrick Lauer
2012-11-12 09:53:57 UTC
Ai! It seems that the fork isn't really pulling in changes from LLVM master, so the question is: how do we maintain that? The cleanest way seems to be introducing 'llvm-amdgpu' package with the forked sources. Make one block the other. Not many packages depend on llvm, so we could probably do with a ||()-dep or just temporarily make users use package.provided. Let's just hope that the new mesa code won't go into a release until it is merged in llvm upstream. Both USE=r600-llvm-compiler and VIDEO_CARDS=radeonsi are disabled by default because they are still under heavy development. Created attachment 329424 [details]
llvm-r600-3.2_pre20121031.ebuild
Starting from llvm-9999.ebuild in portage I have created a proof-of-concept snapshot ebuild for the r600 branch. I also had to work around one compile error in AMD code and some wrong #ifdefs in llvm which were exposed by the AMD code and the workaround.
Would it make sense to also change the mesa-9999 ebuild dependencies to be stricter? At the moment it only depends on >=llvm-3.1 for r600-llvm-compiler. Well, still not sure what to do for llvm 3.2, but for next version, the backend was merged upstream at least :) http://llvm.org/viewvc/llvm-project?view=rev&revision=169915 (In reply to comment #5) > Well, still not sure what to do for llvm 3.2, but for next version, the > backend was merged upstream at least :) > http://llvm.org/viewvc/llvm-project?view=rev&revision=169915 Well, maybe the code will be suitable for backporting. After a small fix for targets list and re-apply cleanly on 3.2_rc3: http://dev.gentoo.org/~voyageur/distfiles/llvm-3.2-r600_backend.patch.gz With this patch and "--enable-experimental-targets=R600" to CONF_FLAGS, compilation seems OK. Now to see how a radeon card accepts this Also, does the target name change cause problem? It was AMDGPU in tstellar's branch I've successfully compiled sys-devel/llvm-9999 with --enable-experimental-targets=R600 (there is no AMDGPU there). Yet media-libs/mesa-9999 could not configure itself, as it checks for AMDGPU into `llvm-config --targets-built` list (for radeonsi). I've hacked configure to check for R600 instead, but it failed to compile due to LLVMInitializeAMDGPUTargetInfo, LLVMInitializeAMDGPUTarget, LLVMInitializeAMDGPUTargetMC and LLVMInitializeAMDGPUAsmPrinter symbols undefined. Either llvm merge is not yet completed, either mesa is not yet ported, but it doesn't work in "easy" way. Well, actually a little more hacking (next few lines of configure to grab libs for r600 instead of amdgpu + version check removal) and replacing said symbols with R600 equivalents actually allowed me to compile mesa. But it's not working anyway (server segfault on opening nearly-fullscreen window), so it's definitly no need to rush with that one. no news on this one ? Since mesa upstream started to require llvm with r600 support, we are not able to install mesa-9999 anymore... ;-( r600 has no special requirements. Only if you enable USE="r600-llvm-compiler" or VIDEO_CARDS="radeonsi", both which are disabled by default, there will be problems. (In reply to comment #11) > r600 has no special requirements. > Only if you enable USE="r600-llvm-compiler" or VIDEO_CARDS="radeonsi", both > which are disabled by default, there will be problems. er... yes, that's what we are talking about. This bug is about media-libs/mesa-9999[r600-llvm-compiler] (?) media-libs/mesa-9.1_rc1::gentoo-x86 now exposes this problem too. Please fix :) I'm seeing the problem with mesa-9.1-rc1 as well. It's in ~arch but won't build. =:^( Is the recommended course of action building mesa-9.1-rc1 with USE=-r600-llvm-compiler but WITH VIDEO_CARDS="radeon r600", or is keeping 9.0.1 with USE=r600-lvm-compiler better, masking mesa-9.1-rc1 until this is resolved? (I saw this mentioned a few weeks ago on phoronix, but hoped either upstream or the gentoo mesa maintainers would have it straightened out and at least an llvm snapshot with the required target and USE flag available by the time an affected mesa hit ~arch. Guess not. Guess if I wanted stale^H^Hble there's a keyword for that, tho.) I'm thinking masking r600-llvm-compiler is the best way to go until the LLVM situation is sorted out. On forums I was advised to file my problem as a bug but since this one deals with the underlying problem I am posting it here (sorry if it's not the right way to proceed). I am trying to emerge media-libs/mesa-9.1_rc2 with USE="-r600-llvm-compiler llvm" and VIDEO_CARDS="radeon radeonsi" (on Radeon HD 7750 - Cape Verde). I have llvm-3.2 without any special flags. I get the following configuration error (the same is with +r600-llvm-compiler): ----- configure: error: LLVM R600 Target not enabled. You can enable it when building the LLVM sources with the --enable-experimental-targets=R600 configure flag ----- In forums I got the suggestion to reemerge mesa with -llvm but then I get: ----- The following REQUIRED_USE flag constraints are unsatisfied: video_cards_radeonsi? ( llvm ) ----- So is there a way to have mesa 9.1 on radeonsi card without using experimental stuff (overlay/9999 ebuilds) ? I suppose I need radeonsi with my card. Or should I rather wait for the new llvm? Thanks. For the record, llvm-9999 can actually be compiled with the r600 backend : http://www.freehackers.org/thomas/2013/02/19/amd-r600-gpu-backend-on-gentoo/ (In reply to comment #17) > For the record, llvm-9999 can actually be compiled with the r600 backend : > http://www.freehackers.org/thomas/2013/02/19/amd-r600-gpu-backend-on-gentoo/ Yes. With llvm-9999 with the --enable-experimental-targets=R600 entry in llvm-9999.ebuild mesa-9999 compiled fine yesterday. I took a snapshot from http://git.overlays.gentoo.org/gitweb/?p=proj/x11.git;a=tree;f=media-libs/mesa;hb=HEAD for the mesa-9999.ebuild media-libs/mesa-9999 was built with the following: USE="classic egl gallium llvm nptl r600-llvm-compiler shared-glapi vdpau xa xorg xvmc -bindist -debug -gbm -gles1 -gles2 -openvg -osmesa -pax_kernel -pic (-selinux) -wayland" VIDEO_CARDS="r600 radeon radeonsi -i915 -i965 -intel -nouveau -r100 -r200 -r300 -vmware" But no luck with mesa-9.1_rc2 : radeon_llvm_emit.cpp:28:30: fatal error: llvm/LLVMContext.h: No such file or directory compilation terminated. gmake[4]: *** [radeon_llvm_emit.lo] Fehler 1 (In reply to comment #18) > (In reply to comment #17) > But no luck with mesa-9.1_rc2 : > > radeon_llvm_emit.cpp:28:30: fatal error: llvm/LLVMContext.h: No such file or > directory > compilation terminated. > gmake[4]: *** [radeon_llvm_emit.lo] Fehler 1 I guess the compilation fix mentionned in my blog was done after rc2. (In reply to comment #19) > (In reply to comment #18) > > (In reply to comment #17) > > But no luck with mesa-9.1_rc2 : > > > > radeon_llvm_emit.cpp:28:30: fatal error: llvm/LLVMContext.h: No such file or > > directory > > compilation terminated. > > gmake[4]: *** [radeon_llvm_emit.lo] Fehler 1 Same problem here with mesa-9.1, sys-devel/llvm-3.2 compiled and installed for me after adding CONF_FLAGS="--enable-experimental-targets=R600" and the patch in comment #7 to the ebuild. media-libs/mesa-9.1 then compiles fine (I have yet to check if it works) but for this warning repeated twice: Package libclc was not found in the pkg-config search path. Perhaps you should add the directory containing `libclc.pc' to the PKG_CONFIG_PATH environment variable No package 'libclc' found libclc appears to be an LLVM library for OpenCL, does it need to be downloaded and installed separately (there is no ebuild for it in portage) or is it something that can be enabled from the llvm ebuild? Sadly, it does not work: X crashes as soon as KDE starts loading. It looks like the error is in KWin but I don't have the time to dig in further. (In reply to comment #22) > Sadly, it does not work: X crashes as soon as KDE starts loading. It looks > like the error is in KWin but I don't have the time to dig in further. Yes, kwin, as a compositing window manager, is kde's major opengl and thus mesa consumer. FWIW, if you go into your kde config at $KDEHOME/share/config/kwinrc ($KDEHOME defaulting to ~/.kde if the var is unset), find section [Compositing], and change the line Enabled=true to Enabled=false, that'll turn off compositing at kde/kwin startup. You can then get into kde, run kde settings (the application formerly known as kcontrol, now incorrectly known as systemsettings, incorrectly since with a few exceptions, it's user-specific kde settings, NOT global system settings) or kcmshell4 kwincompositing, switch to the advanced tab, and set XRender instead of OpenGL, or try OpenGL but without opengl2 shaders (checkbox). Then you should be able to enable effects. XRender should work, but only a few of the effects work with it as most require OpenGL. OpenGL without opengl2 shaders might or might not work. But of course that simply kills use of OpenGL (or at least opengl2 shaders), so you'd simply not be using it then. That might be the best currently available for RadeonSI users, but for r600 thru NI users, USE=-r600-llvm-compiler appears to continue to be the best current alternative (and what I'm using now, with 9.1). If you have this problem --- https://bugs.freedesktop.org/show_bug.cgi?id=61182, you can try kwin_gles. It works without crashes (In reply to comment #21) > sys-devel/llvm-3.2 compiled and installed for me after adding > CONF_FLAGS="--enable-experimental-targets=R600" and the patch in comment #7 > to the ebuild. > > media-libs/mesa-9.1 then compiles fine (I have yet to check if it works) but > for this warning repeated twice: > > Package libclc was not found in the pkg-config search path. > Perhaps you should add the directory containing `libclc.pc' > to the PKG_CONFIG_PATH environment variable > No package 'libclc' found > > libclc appears to be an LLVM library for OpenCL, does it need to be > downloaded and installed separately (there is no ebuild for it in portage) > or is it something that can be enabled from the llvm ebuild? I have an ebuild for dev-libs/libclc on paddymac overlay if that would be convenient for you to use. Please keep this bug strictly about necessary package/ebuild changes. All other issues better discuss in a separate bug report. media-libs/mesa-9999 from x11 overlay compiles fine with USE flag r600-llvm-compiler enabled if llvm-9999 is compiled with --enable-experimental-targets=R600. Please, fix llvm-9999 ebuild as to enable "--enable-experimental-targets=R600" option with a dedicated use flag. Yes, backporting to 3.2 may make a mess (clang for example is sensitive to changes in llvm itself), but adding a flag in -9999 (and upcoming 3.3) is easy * llvm-9999 now has uses VIDEO_CARDS="radeon" to toggle the r600 shader compiler * >=mesa-9.1[r600-llvm-compiler and >=mesa-9.1[video_cards_radeonsi] now depend on llvm[video_cards_radeon] * USE="r600-llvm-compiler" and VIDEO_CARDS="radeonsi" flags will remain masked for mesa-9.1 until llvm-3.3 (or a prerelease/snapshot) enters ~arch Yeps, i can confirm it all works with r600/gallium on ~amd64. Thanks a lot! *** Bug 459168 has been marked as a duplicate of this bug. *** |