<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - 'radeonsi: Failed to create context' with 32 bit applications"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104837">104837</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>'radeonsi: Failed to create context' with 32 bit applications
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DRI
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>XOrg git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>DRM/AMDgpu
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dri-devel@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rafael.ristovski@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=137021" name="attach_137021" title="dmesg log">attachment 137021</a> <a href="attachment.cgi?id=137021&action=edit" title="dmesg log">[details]</a></span>
dmesg log

Running 32bit OpenGL applications on my AMD card with DRI_PRIME=1 produces the
following error, running 64bit applications works just fine.
Somehow I suspect virtual memory is the cause.

libGL: pci id for fd 5: 1002:6823, driver radeonsi
libGL: OpenDriver: trying /usr/lib32/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying /usr/lib32/dri/radeonsi_dri.so
/usr/share/libdrm/amdgpu.ids version: 1.0.0
radeonsi: Failed to create a context.
libGL: Using DRI3 for screen 0
radeonsi: Failed to create a context.
X Error of failed request:  BadValue (integer parameter out of range for
operation)
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  31
  Current serial number in output stream:  33

At the same time, the following messages are logged in dmesg:
(See similar but apparently harmless:
<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - amdgpu 0000:07:00.0: swiotlb buffer is full (sz: 2097152 bytes)"
   href="show_bug.cgi?id=104082">https://bugs.freedesktop.org/show_bug.cgi?id=104082</a>)

[433611.485600] amdgpu 0000:03:00.0: swiotlb buffer is full (sz: 2097152 bytes)
[433611.485602] amdgpu 0000:03:00.0: swiotlb: coherent allocation failed,
size=2097152

Full relevant dmesg log of the accident is attached

Various VRAM/GTT info from boot:

[   10.485945] [drm] amdgpu kernel modesetting enabled.
[   10.486189] amdgpu 0000:03:00.0: enabling device (0000 -> 0003)
[   10.669296] amdgpu 0000:03:00.0: VRAM: 2048M 0x000000F400000000 -
0x000000F47FFFFFFF (2048M used)
[   10.669298] amdgpu 0000:03:00.0: GTT: 1024M 0x0000000000000000 -
0x000000003FFFFFFF
[   10.669387] [drm] amdgpu: 2048M of VRAM memory ready
[   10.669388] [drm] amdgpu: 3072M of GTT memory ready.
[   10.670190] amdgpu 0000:03:00.0: PCIE GART of 1024M enabled (table at
0x000000F400040000).
[   10.685934] [drm] amdgpu: dpm initialized
[   11.043323] [drm] Initialized amdgpu 3.23.0 20150101 for 0000:03:00.0 on
minor 1

Sysinfo:

- Gentoo x86_64
- llvm/clang/mesa/libdrm and friends, including drivers all pulled from git as
of ~2 days ago.

- Intel HD 4400 Gen7.5 Haswell - i915
- AMD Radeon HD 8850M - amdgpu
- Both drivers are using DRI3 for PRIME</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>