From: Thomas Hellstrom <thomas@shipmail.org>
To: "Marek Olšák" <maraeo@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [RFC] drm/ttm: add minimum residency constraint for bo eviction
Date: Thu, 29 Nov 2012 21:40:31 +0100 [thread overview]
Message-ID: <50B7C83F.4050501@shipmail.org> (raw)
In-Reply-To: <CAAxE2A4_2-vK6MHALPFmVZoTmR65iK1=047fXS1wZG5Yg_4z4Q@mail.gmail.com>
On 11/29/2012 08:20 PM, Marek Olšák wrote:
> On Thu, Nov 29, 2012 at 10:18 AM, Thomas Hellstrom <thomas@shipmail.org> wrote:
>> On 11/28/2012 10:51 PM, Marek Olšák wrote:
>>> I think the problem with Radeon/TTM is much deeper. Let me demonstrate
>>> it on the following example.
>>>
>>> Unigine Heaven needs about 385MB of space for static resources, that's
>>> only 75% of my 512MB card. Yet, TTM is not capable of getting all of
>>> that into VRAM. If I allow GTT placements, I get 20 fps, which is the
>>> old Mesa behavior. If I force VRAM placements, I get 3 fps, because we
>>> validate buffers 10 times per frame and there's probably a lot of
>>> buffer evictions during each validation.
>>>
>> Marek,
>> Did you look at the total amount of referenced buffers in the ring including
>> vertex buffers?
>>
>> Depending on how hard you throttle, I guess vertex / index buffer data
>> referenced by the
>> ring commands may well exceed the VRAM limitation.
> Buffers (not textures) take only 30 MB. These are stats for 1 frame of
> Unigine Heaven. Each line is a CS ioctl.
>
> VRAM [used in CS] / [total allocated], GTT [used in CS] / [total allocated]
> 1. VRAM: 171 / 390 MB, GTT: 1 / 5 MB
> 2. VRAM: 144 / 390 MB, GTT: 2 / 5 MB
> 3. VRAM: 184 / 390 MB, GTT: 1 / 5 MB
> 4. VRAM: 35 / 390 MB, GTT: 2 / 5 MB
> 5. VRAM: 119 / 390 MB, GTT: 1 / 5 MB
> 6. VRAM: 207 / 390 MB, GTT: 1 / 5 MB
> 7. VRAM: 65 / 390 MB, GTT: 2 / 5 MB
>
> If I move all buffers (vertex, index, constant, streamout, queries,
> shader code, etc.) to GTT, this is how one frame looks like (not the
> same one though, but it's close):
>
> 1. VRAM: 144 / 359 MB, GTT: 16 / 35 MB
> 2. VRAM: 95 / 359 MB, GTT: 12 / 35 MB
> 3. VRAM: 178 / 359 MB, GTT: 15 / 35 MB
> 4. VRAM: 55 / 359 MB, GTT: 13 / 35 MB
> 5. VRAM: 22 / 359 MB, GTT: 16 / 35 MB
> 6. VRAM: 163 / 359 MB, GTT: 16 / 35 MB
> 7. VRAM: 133 / 359 MB, GTT: 11 / 35 MB
> 8. VRAM: 66 / 359 MB, GTT: 4 / 35 MB
>
> The stats are generated in the Mesa driver based on the driver's
> expectations where buffers should be placed.
>
> I can easily see how VRAM is thrashed with the strict LRU approach.
>
> Also, is it possible that one buffer is moved twice for a single CS
> ioctl? Imagine there's a buffer at the end of the relocation list,
> which is also at the head of the LRU list. Some buffer in the middle
> causes eviction of the last buffer. When the last buffer is validated,
> it's moved back to VRAM. Can it happen?
No. Typically that shouldn't happen. In a typical CS sequence, first all
buffers are reserved, and then all buffers
are validated. Reservation takes them off the LRU list, I'm not 100%
sure Radeon does it this way, but I think so.
/Thomas
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2012-11-29 20:40 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-28 15:58 [RFC] drm/ttm: add minimum residency constraint for bo eviction j.glisse
2012-11-28 15:58 ` [PATCH] " j.glisse
2012-11-28 23:18 ` Thomas Hellstrom
2012-11-28 23:24 ` Jerome Glisse
2012-11-28 23:44 ` Alan Swanson
2012-11-29 0:01 ` Jerome Glisse
2012-11-29 2:15 ` Marek Olšák
2012-11-29 8:04 ` Thomas Hellstrom
2012-11-29 12:52 ` Marek Olšák
2012-11-29 20:33 ` Thomas Hellstrom
2012-11-29 21:58 ` Marek Olšák
2012-11-30 8:38 ` Thomas Hellstrom
2012-11-30 9:39 ` Asynchronous eviction [WAS Re: [PATCH] drm/ttm: add minimum residency constraint for bo eviction] Thomas Hellstrom
2012-11-30 16:30 ` Jerome Glisse
2012-11-30 17:08 ` Thomas Hellstrom
2012-11-30 17:18 ` Jerome Glisse
2012-11-30 17:43 ` Thomas Hellstrom
2012-11-30 18:07 ` Jerome Glisse
2012-11-30 18:31 ` Thomas Hellstrom
2012-11-30 19:25 ` Jerome Glisse
2012-11-30 20:35 ` Thomas Hellstrom
2012-11-30 21:07 ` Jerome Glisse
2012-11-30 21:36 ` Thomas Hellstrom
2012-11-30 22:02 ` Jerome Glisse
2012-11-29 8:41 ` [PATCH] drm/ttm: add minimum residency constraint for bo eviction Thomas Hellstrom
2012-11-29 15:50 ` Jerome Glisse
2012-11-28 21:51 ` [RFC] " Marek Olšák
2012-11-28 23:18 ` Jerome Glisse
2012-11-29 9:18 ` Thomas Hellstrom
2012-11-29 9:28 ` Michel Dänzer
2012-11-29 9:48 ` Thomas Hellstrom
2012-11-29 19:20 ` Marek Olšák
2012-11-29 19:36 ` Jerome Glisse
2012-11-29 20:40 ` Thomas Hellstrom [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50B7C83F.4050501@shipmail.org \
--to=thomas@shipmail.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=maraeo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.