[Mesa-dev] [Bug 106572] Simply linking against libOpenCL.so tries accessing the GPU

2019-09-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106572

GitLab Migration User  changed:

   What|Removed |Added

 Resolution|--- |MOVED
 Status|NEW |RESOLVED

--- Comment #1 from GitLab Migration User  ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1025.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [Bug 106572] Simply linking against libOpenCL.so tries accessing the GPU

2018-05-18 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=106572

Bug ID: 106572
   Summary: Simply linking against libOpenCL.so tries accessing
the GPU
   Product: Mesa
   Version: git
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: bugs.freedesk...@haasn.xyz
QA Contact: mesa-dev@lists.freedesktop.org

$ echo 'int main() {}' > test.c && gcc -o test test.c -lOpenCL && strace -e
open ./test
open("/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
open("/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
open("/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
open("/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
open("/sys/dev/char/226:128/device/drm",
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
open("/sys/dev/char/226:128/device/drm",
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
open("/dev/dri", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 5
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 5
open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 5
open("/sys/dev/char/226:128/device/drm",
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
open("/sys/dev/char/226:128/device/drm",
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
open("/sys/dev/char/226:128/device/drm",
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
+++ exited with 0 +++

This behavior surprises me because e.g. libGL.so does not have the same sort of
behavior, and neither do libvulkan.so or other third party implementations of
OpenGL/OpenCL.

Merely *linking* to a library should not cause any runtime GPU access. Normally
I'd expect this kind of loading logic to happen when the CL device itself is
initialized, similar to how OpenGL's GPU-specific drivers only get initialized
when calling `glXCreateContext` and ditto for vkCreateInstance /
vkCreateDevice.

Context: https://bugs.gentoo.org/show_bug.cgi?id=656086

Since this behavior surprises me, I'm also filing a bug here, even though the
issue is technically downstream. Maybe we could get some elaboration.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev