Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Do I need AMDGPU and SPIRV as LLVM_TARGETS for amdgpu?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 209

PostPosted: Fri Apr 05, 2024 7:06 pm    Post subject: Do I need AMDGPU and SPIRV as LLVM_TARGETS for amdgpu? Reply with quote

I noticed that media-libs/mesa pulls in dev-lang/rust and sys-devel/llvm as dependencies. My graphic card is a Navi 23 [Radeon RX 6600/6600 XT/6600M] and I use the amdgpu driver. Now I am wondering whether I should/must enable AMDGPU and SPIRV as additional LLVM targets for full DRI, OpenGL, Vulcan acceleration.

The x86 target is enabled by default via the selected Portage profile. Unfortunately, there does not seem to be much documentation on when one need those targets or not.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54276
Location: 56N 3W

PostPosted: Fri Apr 05, 2024 7:14 pm    Post subject: Reply with quote

nagmat84,

The simple answer ... yes.

The longer more involved answer. No but ...
The LLVM_TARGETS are not independent, so if you turn one off that you don't need, it can break others that you do need.
Hence they are all forced on.

If you want to play, undo the forcing and turn some off. If you break LLVM, you can keep all the pieces. :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 209

PostPosted: Fri Apr 05, 2024 7:29 pm    Post subject: Reply with quote

Quote:
Hence they are all forced on.
Ahm, no? In my case they are all turned off (except for x86) and I did not change anything with respect to LLVM_TARGETS. The default seems to be to only enable the "native" target.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54276
Location: 56N 3W

PostPosted: Fri Apr 05, 2024 7:44 pm    Post subject: Reply with quote

nagmat84,

Odd, from eix my amd64 has
Code:
sys-devel/llvm
...
LLVM_TARGETS="AArch64 AMDGPU ARM AVR BPF Hexagon Lanai LoongArch MSP430 Mips NVPTX PowerPC RISCV Sparc SystemZ VE WebAssembly X86 XCore -ARC -CSKY -DirectX -M68k -SPIRV -Xtensa")
so almost all are on.

Code:
emerge -pv sys-devel/llvm
...
sys-devel/llvm-18.1.2:18/18.1::gentoo  USE="binutils-plugin libffi ncurses zstd -debug -debuginfod -doc -exegesis -libedit -test -verify-sig -xml -z3" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (LoongArch) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) -ARC -CSKY -DirectX -M68k -SPIRV -Xtensa" 0 KiB

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 209

PostPosted: Fri Apr 05, 2024 9:56 pm    Post subject: Reply with quote

My bad, I was mistaken and did not read the output carefully enough
Code:
/etc/portage # emerge --pretend --verbose sys-devel/llvm:17 sys-devel/llvm:15 dev-lang/rust

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 4.11 s (backtrack: 0/20).

[ebuild   R    ] dev-lang/rust-1.75.0-r1:stable/1.75::gentoo  USE="lto (-big-endian) -clippy -debug -dist -doc (-llvm-libunwind) (-miri) (-nightly) (-parallel-compiler) -profiler -rust-analyzer -rust-src -rustfmt (-system-bootstrap) (-system-llvm) -test -verify-sig -wasm" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse2" LLVM_TARGETS="(X86) -AArch64 -AMDGPU -ARC -ARM -AVR -BPF -CSKY -DirectX -Hexagon -Lanai -LoongArch -M68k -MSP430 -Mips -NVPTX -PowerPC -RISCV -SPIRV -Sparc -SystemZ -VE -WebAssembly -XCore -Xtensa" 0 KiB
[ebuild   R    ] sys-devel/llvm-17.0.6:17::gentoo  USE="binutils-plugin libffi ncurses xml zstd -debug -debuginfod -doc -exegesis -libedit -test -verify-sig -xar -z3" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (LoongArch) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) -ARC -CSKY -DirectX -M68k -SPIRV -Xtensa" 0 KiB
[ebuild   R    ] sys-devel/llvm-15.0.7-r3:15::gentoo  USE="binutils-plugin libffi ncurses xml zstd -debug -doc -exegesis -libedit -test -verify-sig -xar -z3" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="(AArch64) (AMDGPU) (ARM) (AVR) (BPF) (Hexagon) (Lanai) (MSP430) (Mips) (NVPTX) (PowerPC) (RISCV) (Sparc) (SystemZ) (VE) (WebAssembly) (X86) (XCore) (-ARC) (-CSKY) (-DirectX) (-LoongArch) (-M68k) (-SPIRV)" 0 KiB

Total: 3 packages (3 reinstalls), Size of downloads: 0 KiB
Most targets are enabled for sys-devel/llvm.

However, the question still stands for dev-lang/rust. As media-libs/mesa depends on dev-lang/rust, is it necessary to enable AMDGPU for dev-lang/rust, too? However, I do not know for what media-libs/mesa requires dev-lang/rust at all.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54276
Location: 56N 3W

PostPosted: Sat Apr 06, 2024 11:00 am    Post subject: Reply with quote

nagmat84,

My recollection is that rust has its own bundled patched llvm. It does not use the system one.

On that basis,
Code:
[ebuild   R    ] dev-lang/rust-1.76.0-r1:stable/1.76::gentoo  USE="lto system-llvm (-big-endian) -clippy -debug -dist -doc (-llvm-libunwind) (-miri) -nightly (-parallel-compiler) -profiler -rust-analyzer -rust-src -rustfmt -system-bootstrap -test -verify-sig -wasm" CPU_FLAGS_X86="sse2" LLVM_TARGETS="(X86) -AArch64 -AMDGPU -ARC -ARM -AVR -BPF -CSKY -DirectX -Hexagon -Lanai -LoongArch -M68k -MSP430 -Mips -NVPTX -PowerPC -RISCV -SPIRV -Sparc -SystemZ -VE -WebAssembly -XCore -Xtensa"

works, or the build is broken.

I use AMDGU with rust built as above as I can report works for me.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum