Bug 82162 - Syslog flooded by [drm:radeon_gem_object_create] errors
Summary: Syslog flooded by [drm:radeon_gem_object_create] errors
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: high critical
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
: 82783 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-08-05 01:25 UTC by Nick Sarnie
Modified: 2014-08-18 21:01 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
r600g/radeon: Don't try to allocate CMASK BO of size 0 (740 bytes, patch)
2014-08-06 07:35 UTC, Michel Dänzer
Details | Splinter Review

Description Nick Sarnie 2014-08-05 01:25:30 UTC
Hello. I am using the obiaf PPA which is mesa 10.3 git compiled with LLVM 3.5.  My syslog and kern.log spam the error messages below. They filled up my entire hard drive with this error, and the spam occurs constantly. It appears to speed up and only fills the hard drive when in 3D mode. I am using a Radeon HD 7950.



kernel: [41138.121106] [drm:radeon_gem_object_create] *ERROR* Failed to allocate GEM object (0, 6, 4096, -22)
kernel: [41138.121121] [TTM] Illegal buffer object size
kernel: [41138.121123] [TTM] Illegal buffer object size


Thanks for the help.
Comment 1 Nick Sarnie 2014-08-05 01:29:37 UTC
Just a quick update, the spam does not begin until I'm in 3D mode. Once I'm in 3D mode, the spam is constantly and very quick. Once I quit the 3D application, it slows down but is still there. The only way to stop this is to restart X or the computer.
Comment 2 Nick Sarnie 2014-08-05 01:41:16 UTC
Ignore the last comment, spam is constant.
Comment 3 Michel Dänzer 2014-08-05 06:56:33 UTC
Looks like the Mesa radeonsi driver tries to allocate buffer objects of zero bytes size, which isn't allowed.

Since nobody else has reported this, I wonder if your driver binaries got corrupted somehow. Does uninstalling the PPA and installing it again help?
Comment 4 Nick Sarnie 2014-08-05 14:00:13 UTC
(In reply to comment #3)
> Looks like the Mesa radeonsi driver tries to allocate buffer objects of zero
> bytes size, which isn't allowed.
> 
> Since nobody else has reported this, I wonder if your driver binaries got
> corrupted somehow. Does uninstalling the PPA and installing it again help?

Hi Michael, thanks for your response. Since PPA-Purge doesn't work for me with this PPA, I decided to reinstall the OS. All I have done since the stock Mint 17 install is update the packages and install the oibaf PPA. When running dmesg, I see the same errors as before. 

[   67.914111] [TTM] Illegal buffer object size
[   67.914113] [TTM] Illegal buffer object size
[   67.914115] [drm:radeon_gem_object_create] *ERROR* Failed to allocate GEM object (0, 6, 4096, -22)

Any ideas?
Comment 5 mmstickman 2014-08-05 14:34:37 UTC
I've been having the same problem on Arch Linux for a while now with my Radeon HD 7950 too. My Kabini laptop, which is also radeonsi, isn't affected. Dmesg spams the following messages repeatedly:

[ 3069.134039] [TTM] Illegal buffer object size
[ 3069.134046] [drm:radeon_gem_object_create] *ERROR* Failed to allocate GEM object (0, 6, 4096, -22)
Comment 6 Nick Sarnie 2014-08-05 17:51:43 UTC
I tried running a 3D game using the terminal to monitor stdout, and this was constantly spammed as well. Not sure if it gives any additional information.

radeon: Failed to allocate a buffer:
radeon:    size      : 0 bytes
radeon:    alignment : 4096 bytes
radeon:    domains   : 4
radeon:    flags     : 4
Comment 7 Christian König 2014-08-05 17:56:44 UTC
(In reply to comment #6)
> I tried running a 3D game using the terminal to monitor stdout, and this was
> constantly spammed as well. Not sure if it gives any additional information.
> 
> radeon: Failed to allocate a buffer:
> radeon:    size      : 0 bytes
> radeon:    alignment : 4096 bytes
> radeon:    domains   : 4
> radeon:    flags     : 4

Yeah, pretty much the same message from userspace.

Looks like a bug in the userspace driver somewhere. Simplest thing to find it would be to attach a debugger and get a backtrace when the message is printed.
Comment 8 Nick Sarnie 2014-08-05 18:14:09 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > I tried running a 3D game using the terminal to monitor stdout, and this was
> > constantly spammed as well. Not sure if it gives any additional information.
> > 
> > radeon: Failed to allocate a buffer:
> > radeon:    size      : 0 bytes
> > radeon:    alignment : 4096 bytes
> > radeon:    domains   : 4
> > radeon:    flags     : 4
> 
> Yeah, pretty much the same message from userspace.
> 
> Looks like a bug in the userspace driver somewhere. Simplest thing to find
> it would be to attach a debugger and get a backtrace when the message is
> printed.

Hi, thanks for the response. I don't really know what I'm doing with GDB so I'll explain what I did to get this output. I installed all of the dbg mesa packages from the PPA. Then, I ran the command "LIBGL_DEBUG=verbose gdb glxgears", and when error printed(immedaitely), I pressed Ctrl+C and then typed bt full. If there's another way to do this please let me know.

http://pastebin.com/v1nA7JWY
Comment 9 Michel Dänzer 2014-08-06 02:33:52 UTC
You need to set a breakpoint in the function printing the messages before running glxgears. Something like

 b radeon_bomgr_create_bo if size == 0

should do the trick. Then get the backtrace when the breakpoint triggers.
Comment 10 Nick Sarnie 2014-08-06 04:08:58 UTC
(In reply to comment #9)
> You need to set a breakpoint in the function printing the messages before
> running glxgears. Something like
> 
>  b radeon_bomgr_create_bo if size == 0
> 
> should do the trick. Then get the backtrace when the breakpoint triggers.

Hi Michael, here's the backtrace from that breakpoint. Please let me know if you need anything I really want this bug fixed.


http://pastebin.com/Lw6rtfg8
Comment 11 Michel Dänzer 2014-08-06 07:35:51 UTC
Created attachment 104132 [details] [review]
r600g/radeon: Don't try to allocate CMASK BO of size 0

This patch should at least work around the problem, but I'm not sure it's the proper fix.
Comment 12 Nick Sarnie 2014-08-06 14:13:33 UTC
(In reply to comment #11)
> Created attachment 104132 [details] [review] [review]
> r600g/radeon: Don't try to allocate CMASK BO of size 0
> 
> This patch should at least work around the problem, but I'm not sure it's
> the proper fix.

Michel, the patch appears to fix the problem without any sideeffects. Is there any chance of it getting into the main git? Thanks.
Comment 13 Nick Sarnie 2014-08-06 14:39:49 UTC
Sorry, it appears the issue has not been fixed. The message "radeon: Failed to allocate a buffer" no longer prints, but the original radeon_gem_object_create message still spams dmesg and kern.log.
Comment 14 Michel Dänzer 2014-08-06 15:09:04 UTC
(In reply to comment #13)
> Sorry, it appears the issue has not been fixed. The message "radeon: Failed
> to allocate a buffer" no longer prints, but the original
> radeon_gem_object_create message still spams dmesg and kern.log.

Did you restart X after building Mesa with the patch?
Comment 15 Nick Sarnie 2014-08-06 15:13:36 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Sorry, it appears the issue has not been fixed. The message "radeon: Failed
> > to allocate a buffer" no longer prints, but the original
> > radeon_gem_object_create message still spams dmesg and kern.log.
> 
> Did you restart X after building Mesa with the patch?

Wow, I'm an idiot. Yeah, everything is completely fixed after restarting X. No side effects or log spam. Thank you based Michel.
Comment 16 Nick Sarnie 2014-08-06 15:16:26 UTC
Any chance of seeing this in the git?
Comment 17 Christian König 2014-08-06 15:24:58 UTC
(In reply to comment #16)
> Any chance of seeing this in the git?

Yeah, but we might want to investigate further.

Somehow the size for the CMASK buffer ends up beeing zero. It's good to catch that case, but we might want to figure out why it happened in the first place.
Comment 18 Nick Sarnie 2014-08-06 15:31:42 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > Any chance of seeing this in the git?
> 
> Yeah, but we might want to investigate further.
> 
> Somehow the size for the CMASK buffer ends up beeing zero. It's good to
> catch that case, but we might want to figure out why it happened in the
> first place.

Anything I can do to help?
Comment 19 Marek Olšák 2014-08-07 10:10:15 UTC
Could you please set a breakpoint in si_texture_get_cmask_info and print:

rscreen->tiling_info AND rscreen->info

OR

pipe_interleave_bytes AND num_pipes

Thanks.
Comment 20 Nick Sarnie 2014-08-07 13:34:27 UTC
(In reply to comment #19)
> Could you please set a breakpoint in si_texture_get_cmask_info and print:
> 
> rscreen->tiling_info AND rscreen->info
> 
> OR
> 
> pipe_interleave_bytes AND num_pipes
> 
> Thanks.

Hi Marek, 

As I said earlier I don't know what I'm doing with GDB.I set the breakpoint with "b si_texture_get_cmask_info", please let me know if that is wrong.

Here is the output from all of those:

(gdb) p rscreen->tiling_info
value has been optimized out
(gdb) p rscreen->info
value has been optimized out


(gdb) p pipe_interleave_bytes
$1 = 256
(gdb) p num_pipes
$2 = 12
Comment 21 Marek Olšák 2014-08-07 14:27:56 UTC
Thanks. The real problem is that num_pipes is 12. That's good to know. I guess I just need to get the number of pipes from GB_TILE_MODE, because that's what we need for CMASK and HTILE calculations. That would be P8 or 8 pipes.
Comment 22 Nick Sarnie 2014-08-07 14:29:31 UTC
(In reply to comment #21)
> Thanks. The real problem is that num_pipes is 12. That's good to know. I
> guess I just need to get the number of pipes from GB_TILE_MODE, because
> that's what we need for CMASK and HTILE calculations. That would be P8 or 8
> pipes.

Awesome, any more information you need from me? I can test any fixes.
Comment 23 mmstickman 2014-08-07 16:57:12 UTC
Would be nice to get a patch out for the stable mesa builds as they are also affected by this bug.
Comment 24 Marek Olšák 2014-08-09 21:53:28 UTC
Fixed by 955505f6ff1c8bba7eb142200d3bd065eb4d2297. The commit has been nominated for inclusion in the next stable release. Closing.
Comment 25 Nick Sarnie 2014-08-09 21:54:57 UTC
(In reply to comment #24)
> Fixed by 955505f6ff1c8bba7eb142200d3bd065eb4d2297. The commit has been
> nominated for inclusion in the next stable release. Closing.

Thank you very much!
Comment 26 mmstickman 2014-08-14 17:34:29 UTC
After compiling the latest version of mesa from git, I'm still getting this bug with my Radeon HD 7950 spamming the system log.

[  372.835016] [TTM] Illegal buffer object size
[  372.835019] [TTM] Illegal buffer object size
[  372.835021] [drm:radeon_gem_object_create] *ERROR* Failed to allocate GEM object (0, 6, 4096, -22)

So it doesn't seem to be fixed for me at least.
Comment 27 Nick Sarnie 2014-08-14 17:43:39 UTC
(In reply to comment #26)
> After compiling the latest version of mesa from git, I'm still getting this
> bug with my Radeon HD 7950 spamming the system log.
> 
> [  372.835016] [TTM] Illegal buffer object size
> [  372.835019] [TTM] Illegal buffer object size
> [  372.835021] [drm:radeon_gem_object_create] *ERROR* Failed to allocate GEM
> object (0, 6, 4096, -22)
> 
> So it doesn't seem to be fixed for me at least.

You need to compile the 32 bit mesa packages you are using as well. It's must easier to just install the oibaf PPA. I have no issues after the fix.
Comment 28 mmstickman 2014-08-14 18:00:59 UTC
That's right -- it's working now. No need for PPAs on Arch when you have the AUR. There's also a pacman repository for mesa-git that compiles daily so it's just a matter of installing lib32-mesa-git and mesa-git.
Comment 29 Nick Sarnie 2014-08-14 18:01:40 UTC
(In reply to comment #28)
> That's right -- it's working now. No need for PPAs on Arch when you have the
> AUR. There's also a pacman repository for mesa-git that compiles daily so
> it's just a matter of installing lib32-mesa-git and mesa-git.

Ah, I'm a debian-based plebian. Glad to see it works.
Comment 30 Alex Deucher 2014-08-18 21:01:04 UTC
*** Bug 82783 has been marked as a duplicate of this bug. ***


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.