Bug 94500

Summary: Seems to assume /dev/dri/cardX should match one X server is using
Product: Beignet Reporter: Tyson Whitehead <twhitehead>
Component: BeignetAssignee: rongyang <rong.r.yang>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Strace of "clcc -l" with DISPLAY set
Strace of "clcc -l" with DISPLAY unset
Strace of "clcc -l" with DISPLAY set (longer string capture)
Strace of "clcc -l" with DISPLAY unset (longer string capture)

Description Tyson Whitehead 2016-03-11 17:31:18 UTC
I have an Intel i5-4690K based machine with an external AMD Radeon R7 370 card that runs the displays.  It is running Debian unstable with beignet 1.1.1 and kernel 4.4.4.[*]

It seems that beignet will not work unless DISPLAY is either not set or set to a display which is bring run by the Intel GPU.  For example, using clcc to query the devices from my X session running on the AMD GPU

https://github.com/twhitehead/clcc

$ clcc -l
DRM_IOCTL_I915_GEM_APERTURE failed: No such file or directory
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
DRM_IOCTL_I915_GEM_APERTURE failed: No such file or directory
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
DRM_IOCTL_I915_GEM_APERTURE failed: No such file or directory
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
Platform 0: Clover
  Device 0: AMD PITCAIRN (DRM 2.43.0, LLVM 3.7.1)
      Type = [ GPU, Accelerator, Custom ]
      Maximum compute units = 20
      Maximum work item dimensions = 3
      Maximum work item sizes = [ 256, 256, 256 ]
      Maximum work group size = 256
      Image support = False
      Global memory size = 1073741824
      Local memory size = 32768
Platform 1: Intel Gen OCL Driver
DRM_IOCTL_I915_GEM_APERTURE failed: No such file or directory
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
Unable to get number of devices for platform: Device not found

$ DISPLAY= clcc -l
Platform 0: Clover
  Device 0: AMD PITCAIRN (DRM 2.43.0, LLVM 3.7.1)
      Type = [ GPU, Accelerator, Custom ]
      Maximum compute units = 20
      Maximum work item dimensions = 3
      Maximum work item sizes = [ 256, 256, 256 ]
      Maximum work group size = 256
      Image support = False
      Global memory size = 1073741824
      Local memory size = 32768
Platform 1: Intel Gen OCL Driver
  Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
      Type = [ GPU, Accelerator, Custom ]
      Maximum compute units = 20
      Maximum work item dimensions = 3
      Maximum work item sizes = [ 512, 512, 512 ]
      Maximum work group size = 512
      Image support = True
        Image2D maximum width = 8192
        Image2D maximum height = 8192
        Image3D maximum width = 8192
        Image3D maximum height = 8192
        Image3D maximum depth = 2048
      Global memory size = 2147483648
      Local memory size = 65536


Stracing clcc in both cases reveals the issue is that if DISPLAY is set then beignet jumps straight to trying to perform a bunch of DRM_IOCTRL_I915_* operations on the AMD GPU card /dev/dri/card1.  These fail causing it to spit out all the various error messages above.

I'll attach the straces too so you can see the difference.

Thanks!  -Tyson

[*] I believe the kernel version is 4.4.4, but I'm not 100% as uname is reporting 4.4.0.  I thing this is because Debian is eating the last release number.

[    0.000000] Linux version 4.4.0-1-amd64 (debian-kernel@lists.debian.org) (gcc version 5.3.1 20160224 (Debian 5.3.1-10) ) #1 SMP Debian 4.4.4-2 (2016-03-09)
Comment 1 Tyson Whitehead 2016-03-11 17:32:29 UTC
Created attachment 122233 [details]
Strace of "clcc -l" with DISPLAY set
Comment 2 Tyson Whitehead 2016-03-11 17:32:51 UTC
Created attachment 122234 [details]
Strace of "clcc -l" with DISPLAY unset
Comment 3 Tyson Whitehead 2016-03-11 17:36:49 UTC
Created attachment 122235 [details]
Strace of "clcc -l" with DISPLAY set (longer string capture)
Comment 4 Tyson Whitehead 2016-03-11 17:37:25 UTC
Created attachment 122236 [details]
Strace of "clcc -l" with DISPLAY unset (longer string capture)
Comment 5 GitLab Migration User 2018-10-12 21:26:09 UTC
-- 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/beignet/beignet/issues/55.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.