Re: [Mesa-dev] [PATCH 3/3] gallium/radeon: pass LLVM processor to the disk shader cache

2017-08-18 Thread Timothy Arceri

On 18/08/17 20:49, Nicolai Hähnle wrote:

On 11.08.2017 20:37, Marek Olšák wrote:
On Fri, Aug 11, 2017 at 6:00 PM, Nicolai Hähnle  
wrote:

On 10.08.2017 21:57, Marek Olšák wrote:


From: Marek Olšák 

---
   src/gallium/drivers/radeon/r600_pipe_common.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c
b/src/gallium/drivers/radeon/r600_pipe_common.c
index 95458d2e..0038c9a 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -878,21 +878,21 @@ static void r600_disk_cache_create(struct
r600_common_screen *rscreen)
   #endif
 if (res != -1) {
 /* These flags affect shader compilation. */
 uint64_t shader_debug_flags =
 rscreen->debug_flags &
 (DBG_FS_CORRECT_DERIVS_AFTER_KILL |
  DBG_SI_SCHED |
  DBG_UNSAFE_MATH);
 rscreen->disk_shader_cache =
-
disk_cache_create(r600_get_family_name(rscreen),
+
disk_cache_create(r600_get_llvm_processor_name(rscreen->family),



What's the advantage of this?


It's added to the shader cache key. It allows shaders cached for
Vega10 to be used by Raven and vice versa. Same for Polaris11 and
Polaris12. It makes things nicer for some multi-GPU setups or when
swapping GPUs.


I'm not a huge fan of this since the shader code does have access to the 
family, and there might be a need for family-specific workarounds. I'm 
actually not a huge fan of this overall, because the debug_flags thing 
seems flaky as well.


There's currently some corruption in Unigine demos which seems related 
to the shader cache, which just goes to show how difficult it is to 
really get this stuff right. I'd rather be on the safe side.


I'm not sure if its related, but I noticed recently that there was at 
least 1 piglit test that seems to have regressed for the shader cache.


Should be reproducible by running piglit twice in a row, I haven't 
looked into it any further and can't recall what it was testing.





Cheers,
Nicolai



Marek





___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/3] gallium/radeon: pass LLVM processor to the disk shader cache

2017-08-18 Thread Marek Olšák
On Fri, Aug 18, 2017 at 12:49 PM, Nicolai Hähnle  wrote:
> On 11.08.2017 20:37, Marek Olšák wrote:
>>
>> On Fri, Aug 11, 2017 at 6:00 PM, Nicolai Hähnle 
>> wrote:
>>>
>>> On 10.08.2017 21:57, Marek Olšák wrote:


 From: Marek Olšák 

 ---
src/gallium/drivers/radeon/r600_pipe_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c
 b/src/gallium/drivers/radeon/r600_pipe_common.c
 index 95458d2e..0038c9a 100644
 --- a/src/gallium/drivers/radeon/r600_pipe_common.c
 +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
 @@ -878,21 +878,21 @@ static void r600_disk_cache_create(struct
 r600_common_screen *rscreen)
#endif
  if (res != -1) {
  /* These flags affect shader compilation. */
  uint64_t shader_debug_flags =
  rscreen->debug_flags &
  (DBG_FS_CORRECT_DERIVS_AFTER_KILL |
   DBG_SI_SCHED |
   DBG_UNSAFE_MATH);
  rscreen->disk_shader_cache =
 -
 disk_cache_create(r600_get_family_name(rscreen),
 +
 disk_cache_create(r600_get_llvm_processor_name(rscreen->family),
>>>
>>>
>>>
>>> What's the advantage of this?
>>
>>
>> It's added to the shader cache key. It allows shaders cached for
>> Vega10 to be used by Raven and vice versa. Same for Polaris11 and
>> Polaris12. It makes things nicer for some multi-GPU setups or when
>> swapping GPUs.
>
>
> I'm not a huge fan of this since the shader code does have access to the
> family, and there might be a need for family-specific workarounds. I'm
> actually not a huge fan of this overall, because the debug_flags thing seems
> flaky as well.
>
> There's currently some corruption in Unigine demos which seems related to
> the shader cache, which just goes to show how difficult it is to really get
> this stuff right. I'd rather be on the safe side.

I've dropped this patch.

What corruption in Unigine?

Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/3] gallium/radeon: pass LLVM processor to the disk shader cache

2017-08-18 Thread Nicolai Hähnle

On 11.08.2017 20:37, Marek Olšák wrote:

On Fri, Aug 11, 2017 at 6:00 PM, Nicolai Hähnle  wrote:

On 10.08.2017 21:57, Marek Olšák wrote:


From: Marek Olšák 

---
   src/gallium/drivers/radeon/r600_pipe_common.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c
b/src/gallium/drivers/radeon/r600_pipe_common.c
index 95458d2e..0038c9a 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -878,21 +878,21 @@ static void r600_disk_cache_create(struct
r600_common_screen *rscreen)
   #endif
 if (res != -1) {
 /* These flags affect shader compilation. */
 uint64_t shader_debug_flags =
 rscreen->debug_flags &
 (DBG_FS_CORRECT_DERIVS_AFTER_KILL |
  DBG_SI_SCHED |
  DBG_UNSAFE_MATH);
 rscreen->disk_shader_cache =
-
disk_cache_create(r600_get_family_name(rscreen),
+
disk_cache_create(r600_get_llvm_processor_name(rscreen->family),



What's the advantage of this?


It's added to the shader cache key. It allows shaders cached for
Vega10 to be used by Raven and vice versa. Same for Polaris11 and
Polaris12. It makes things nicer for some multi-GPU setups or when
swapping GPUs.


I'm not a huge fan of this since the shader code does have access to the 
family, and there might be a need for family-specific workarounds. I'm 
actually not a huge fan of this overall, because the debug_flags thing 
seems flaky as well.


There's currently some corruption in Unigine demos which seems related 
to the shader cache, which just goes to show how difficult it is to 
really get this stuff right. I'd rather be on the safe side.


Cheers,
Nicolai



Marek




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/3] gallium/radeon: pass LLVM processor to the disk shader cache

2017-08-11 Thread Marek Olšák
On Fri, Aug 11, 2017 at 6:00 PM, Nicolai Hähnle  wrote:
> On 10.08.2017 21:57, Marek Olšák wrote:
>>
>> From: Marek Olšák 
>>
>> ---
>>   src/gallium/drivers/radeon/r600_pipe_common.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c
>> b/src/gallium/drivers/radeon/r600_pipe_common.c
>> index 95458d2e..0038c9a 100644
>> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
>> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
>> @@ -878,21 +878,21 @@ static void r600_disk_cache_create(struct
>> r600_common_screen *rscreen)
>>   #endif
>> if (res != -1) {
>> /* These flags affect shader compilation. */
>> uint64_t shader_debug_flags =
>> rscreen->debug_flags &
>> (DBG_FS_CORRECT_DERIVS_AFTER_KILL |
>>  DBG_SI_SCHED |
>>  DBG_UNSAFE_MATH);
>> rscreen->disk_shader_cache =
>> -
>> disk_cache_create(r600_get_family_name(rscreen),
>> +
>> disk_cache_create(r600_get_llvm_processor_name(rscreen->family),
>
>
> What's the advantage of this?

It's added to the shader cache key. It allows shaders cached for
Vega10 to be used by Raven and vice versa. Same for Polaris11 and
Polaris12. It makes things nicer for some multi-GPU setups or when
swapping GPUs.

Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/3] gallium/radeon: pass LLVM processor to the disk shader cache

2017-08-11 Thread Marek Olšák
On Fri, Aug 11, 2017 at 3:09 AM, Timothy Arceri  wrote:
> On 11/08/17 05:57, Marek Olšák wrote:
>>
>> From: Marek Olšák 
>>
>> ---
>>   src/gallium/drivers/radeon/r600_pipe_common.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c
>> b/src/gallium/drivers/radeon/r600_pipe_common.c
>> index 95458d2e..0038c9a 100644
>> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
>> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
>> @@ -878,21 +878,21 @@ static void r600_disk_cache_create(struct
>> r600_common_screen *rscreen)
>>   #endif
>> if (res != -1) {
>> /* These flags affect shader compilation. */
>> uint64_t shader_debug_flags =
>> rscreen->debug_flags &
>> (DBG_FS_CORRECT_DERIVS_AFTER_KILL |
>>  DBG_SI_SCHED |
>>  DBG_UNSAFE_MATH);
>> rscreen->disk_shader_cache =
>> -
>> disk_cache_create(r600_get_family_name(rscreen),
>> +
>> disk_cache_create(r600_get_llvm_processor_name(rscreen->family),
>
>
> I take it this will always by more fine grained than any compilation options
> for the GLSL/TGSI stages?
>
> Otherwise maybe we should store both like we do for the Mesa/LLVM build
> timestamps.

I don't understand.

Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/3] gallium/radeon: pass LLVM processor to the disk shader cache

2017-08-10 Thread Timothy Arceri

On 11/08/17 05:57, Marek Olšák wrote:

From: Marek Olšák 

---
  src/gallium/drivers/radeon/r600_pipe_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c 
b/src/gallium/drivers/radeon/r600_pipe_common.c
index 95458d2e..0038c9a 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -878,21 +878,21 @@ static void r600_disk_cache_create(struct 
r600_common_screen *rscreen)
  #endif
if (res != -1) {
/* These flags affect shader compilation. */
uint64_t shader_debug_flags =
rscreen->debug_flags &
(DBG_FS_CORRECT_DERIVS_AFTER_KILL |
 DBG_SI_SCHED |
 DBG_UNSAFE_MATH);
  
  			rscreen->disk_shader_cache =

-   disk_cache_create(r600_get_family_name(rscreen),
+   
disk_cache_create(r600_get_llvm_processor_name(rscreen->family),


I take it this will always by more fine grained than any compilation 
options for the GLSL/TGSI stages?


Otherwise maybe we should store both like we do for the Mesa/LLVM build 
timestamps.




  timestamp_str,
  shader_debug_flags);
free(timestamp_str);
}
}
  }
  
  static struct disk_cache *r600_get_disk_shader_cache(struct pipe_screen *pscreen)

  {
struct r600_common_screen *rscreen = (struct 
r600_common_screen*)pscreen;


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/3] gallium/radeon: pass LLVM processor to the disk shader cache

2017-08-10 Thread Marek Olšák
From: Marek Olšák 

---
 src/gallium/drivers/radeon/r600_pipe_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c 
b/src/gallium/drivers/radeon/r600_pipe_common.c
index 95458d2e..0038c9a 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -878,21 +878,21 @@ static void r600_disk_cache_create(struct 
r600_common_screen *rscreen)
 #endif
if (res != -1) {
/* These flags affect shader compilation. */
uint64_t shader_debug_flags =
rscreen->debug_flags &
(DBG_FS_CORRECT_DERIVS_AFTER_KILL |
 DBG_SI_SCHED |
 DBG_UNSAFE_MATH);
 
rscreen->disk_shader_cache =
-   disk_cache_create(r600_get_family_name(rscreen),
+   
disk_cache_create(r600_get_llvm_processor_name(rscreen->family),
  timestamp_str,
  shader_debug_flags);
free(timestamp_str);
}
}
 }
 
 static struct disk_cache *r600_get_disk_shader_cache(struct pipe_screen 
*pscreen)
 {
struct r600_common_screen *rscreen = (struct 
r600_common_screen*)pscreen;
-- 
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev