Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 902449 - sys-libs/libomp-16.0.0: sandbox access violation with LLVM_TARGETS=AMDGPU
Summary: sys-libs/libomp-16.0.0: sandbox access violation with LLVM_TARGETS=AMDGPU
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-20 16:39 UTC by Andrei Slavoiu
Modified: 2023-03-23 11:57 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,23.76 KB, text/plain)
2023-03-20 16:41 UTC, Andrei Slavoiu
Details
emerge --info (emerge.info,9.03 KB, text/plain)
2023-03-20 16:41 UTC, Andrei Slavoiu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Slavoiu 2023-03-20 16:39:22 UTC
* ----------------------- SANDBOX ACCESS VIOLATION SUMMARY -----------------------
 * LOG FILE: "/var/tmp/portage/sys-libs/libomp-16.0.0/temp/sandbox.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /dev/kfd
A: /dev/kfd
R: /dev/kfd
C: /usr/lib/llvm/16/bin/amdgpu-arch 
 * --------------------------------------------------------------------------------


Reproducible: Always
Comment 1 Andrei Slavoiu 2023-03-20 16:41:14 UTC
Created attachment 858441 [details]
build.log
Comment 2 Andrei Slavoiu 2023-03-20 16:41:31 UTC
Created attachment 858443 [details]
emerge --info
Comment 3 Andrei Slavoiu 2023-03-20 16:53:49 UTC
It seems adding `addpredict /dev/kfd` to `multilib_src_configure()` is enough to build successfully.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-03-21 12:08:22 UTC
Do you have libcuda or libveo in /usr/lib*?  I'm wondering why I don't get this error on my system.
Comment 5 Andrei Slavoiu 2023-03-21 12:27:40 UTC
(In reply to Michał Górny from comment #4)
> Do you have libcuda or libveo in /usr/lib*?  I'm wondering why I don't get
> this error on my system.

I'm sure libcuda is something Nvidia specific, probably libveo as well. I don't have either of them. This is about AMD cards, not Nvidia, the ebuild already contains `addpredict /dev/nvidiactl`.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-03-21 12:33:54 UTC
Oh, I see that it's used by amdgpu-arch now.  I guess it doesn't happen for me because I'm testing in nspawn container and there's no /dev/kfd there.  Lemme try on a regular system.
Comment 7 Larry the Git Cow gentoo-dev 2023-03-21 15:05:23 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c928da1854b76d608773485d2416fdc4663b3635

commit c928da1854b76d608773485d2416fdc4663b3635
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2023-03-21 12:57:51 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2023-03-21 15:05:19 +0000

    sys-libs/libomp: Fix trying to access AMD GPUs
    
    Prevent the CMake script from starting amdgpu-arch tool that accesses
    the GPU in order to determine AMDGPU-based tests can be run.
    We don't want the test suite to access the GPU, so just hard-disable
    that.
    
    Closes: https://bugs.gentoo.org/902449
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 sys-libs/libomp/libomp-16.0.0.9999.ebuild        | 2 ++
 sys-libs/libomp/libomp-16.0.0.ebuild             | 2 ++
 sys-libs/libomp/libomp-17.0.0.9999.ebuild        | 2 ++
 sys-libs/libomp/libomp-17.0.0_pre20230314.ebuild | 2 ++
 4 files changed, 8 insertions(+)
Comment 8 Attila Tóth 2023-03-23 10:41:55 UTC
(In reply to Michał Górny from comment #6)
> Oh, I see that it's used by amdgpu-arch now.  I guess it doesn't happen for
> me because I'm testing in nspawn container and there's no /dev/kfd there. 
> Lemme try on a regular system.

Dear Sam,

I'm sorry to interrupt, but I also have an AMD arch and don't have cuda installed and run into this bug. I see, that the patch sets AMD arch to NOTFOUND. I'm contemplating on it, whether it is the best way providing optimal outcome/function to handle this and not instructing the ebuild to disregard access to the kfd dev, like it was proposed before?

Thanks:
Dw.