Re: [Mesa-dev] [PATCH] nvc0: enable compute support on Fermi

2015-11-06 Thread Hans de Goede

Hi,

On 06-11-15 00:51, Samuel Pitoiset wrote:



On 11/06/2015 12:43 AM, Ilia Mirkin wrote:

On Thu, Nov 5, 2015 at 6:41 PM, Samuel Pitoiset
 wrote:

Altough the compute support is still not complete because textures and
surfaces need to be implemented, it allows to launch very simple compute
kernel like one which reads reading MP performance counters.


Didn't those end up breaking 3d rendering? Have you figured out what
was overwriting what?


This doesn't break any stuff related to 3D rendering. The compute kernel for 
reading perf counters has been tested a lot on different chips.

The compute support is already enabled on Kepler and it doesn't seem to break 
3D rendering, btw.

In the series which fixed those perf counters, I actually introduced a bug 
which has been fixed since: fc5ae0c13f71f049065b1422c20491d2264ae164





This turns on PIPE_CAP_COMPUTE and PIPE_SHADER_COMPUTE.

Signed-off-by: Samuel Pitoiset 
---
  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 7d96977..5b7b39b 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -186,7 +186,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
 case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
 case PIPE_CAP_COMPUTE:
-  return (class_3d == NVE4_3D_CLASS) ? 1 : 0;
+  return 1;


Of course this also enables it for NVF0_3D_CLASS. Pretty sure compute
doesn't work there for some dumb reason (like we're missing some in
our ctxsw fw...)


Hmm, my only compute capable card actually is a nvf0 card (gk208 based). Can you
provide some quick test instructions how I can test compute on that card
(with the patch from this thread applied) ?

And if it does not work, any suggestions how to go about debugging this ?
Or better any info I can provide to help you debug this :)

Regards,

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


Re: [Mesa-dev] [PATCH] nvc0: enable compute support on Fermi

2015-11-06 Thread Samuel Pitoiset



On 11/06/2015 11:23 AM, Hans de Goede wrote:

Hi,

On 06-11-15 00:51, Samuel Pitoiset wrote:



On 11/06/2015 12:43 AM, Ilia Mirkin wrote:

On Thu, Nov 5, 2015 at 6:41 PM, Samuel Pitoiset
 wrote:

Altough the compute support is still not complete because textures and
surfaces need to be implemented, it allows to launch very simple
compute
kernel like one which reads reading MP performance counters.


Didn't those end up breaking 3d rendering? Have you figured out what
was overwriting what?


This doesn't break any stuff related to 3D rendering. The compute
kernel for reading perf counters has been tested a lot on different
chips.

The compute support is already enabled on Kepler and it doesn't seem
to break 3D rendering, btw.

In the series which fixed those perf counters, I actually introduced a
bug which has been fixed since: fc5ae0c13f71f049065b1422c20491d2264ae164





This turns on PIPE_CAP_COMPUTE and PIPE_SHADER_COMPUTE.

Signed-off-by: Samuel Pitoiset 
---
  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 7d96977..5b7b39b 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -186,7 +186,7 @@ nvc0_screen_get_param(struct pipe_screen
*pscreen, enum pipe_cap param)
 case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
 case PIPE_CAP_COMPUTE:
-  return (class_3d == NVE4_3D_CLASS) ? 1 : 0;
+  return 1;


Of course this also enables it for NVF0_3D_CLASS. Pretty sure compute
doesn't work there for some dumb reason (like we're missing some in
our ctxsw fw...)


Hmm, my only compute capable card actually is a nvf0 card (gk208 based).
Can you
provide some quick test instructions how I can test compute on that card
(with the patch from this thread applied) ?

And if it does not work, any suggestions how to go about debugging this ?
Or better any info I can provide to help you debug this :)



Unfortunately, the compute support is only supported on Fermi and Kepler 
(< GK110).


I could have a look and implement it for your card but since I don't 
have this chipset, this is not going to be easy.


Anyway, the first step is to trace what the blob does using 
valgrind-mmt. Basically, the vectorAdd sample in CUDA should do the job


http://nouveau.freedesktop.org/wiki/Valgrind-mmt/

Once it's done, please send me the MMT trace.

But the quickest way for you to test that compute support would be to 
have a chip < GK110 :-)



Regards,

Hans


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


Re: [Mesa-dev] [PATCH] nvc0: enable compute support on Fermi

2015-11-06 Thread Ilia Mirkin
On Fri, Nov 6, 2015 at 5:23 AM, Hans de Goede  wrote:
> On 06-11-15 00:51, Samuel Pitoiset wrote:
>> On 11/06/2015 12:43 AM, Ilia Mirkin wrote:
>>> Of course this also enables it for NVF0_3D_CLASS. Pretty sure compute
>>> doesn't work there for some dumb reason (like we're missing some in
>>> our ctxsw fw...)
>
> Hmm, my only compute capable card actually is a nvf0 card (gk208 based). Can
> you
> provide some quick test instructions how I can test compute on that card
> (with the patch from this thread applied) ?
>
> And if it does not work, any suggestions how to go about debugging this ?
> Or better any info I can provide to help you debug this :)

As I recall, merely turning the support on would cause the screen init
function to do something which would result in a dmesg spew from the
kernel (something about the ctxsw fw being unhappy... maybe?). Since
compute didn't actually do anything particularly useful, seemed
easiest to just disable it. Sorry, I don't remember specifics.

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


Re: [Mesa-dev] [PATCH] nvc0: enable compute support on Fermi

2015-11-05 Thread Samuel Pitoiset



On 11/06/2015 12:43 AM, Ilia Mirkin wrote:

On Thu, Nov 5, 2015 at 6:41 PM, Samuel Pitoiset
 wrote:

Altough the compute support is still not complete because textures and
surfaces need to be implemented, it allows to launch very simple compute
kernel like one which reads reading MP performance counters.


Didn't those end up breaking 3d rendering? Have you figured out what
was overwriting what?


This doesn't break any stuff related to 3D rendering. The compute kernel 
for reading perf counters has been tested a lot on different chips.


The compute support is already enabled on Kepler and it doesn't seem to 
break 3D rendering, btw.


In the series which fixed those perf counters, I actually introduced a 
bug which has been fixed since: fc5ae0c13f71f049065b1422c20491d2264ae164






This turns on PIPE_CAP_COMPUTE and PIPE_SHADER_COMPUTE.

Signed-off-by: Samuel Pitoiset 
---
  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 7d96977..5b7b39b 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -186,7 +186,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum 
pipe_cap param)
 case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
 case PIPE_CAP_COMPUTE:
-  return (class_3d == NVE4_3D_CLASS) ? 1 : 0;
+  return 1;


Of course this also enables it for NVF0_3D_CLASS. Pretty sure compute
doesn't work there for some dumb reason (like we're missing some in
our ctxsw fw...)


 case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ? 1 : 0;

@@ -245,8 +245,6 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen, 
unsigned shader,
   return 0;
break;
 case PIPE_SHADER_COMPUTE:
-  if (class_3d != NVE4_3D_CLASS)
- return 0;
break;
 default:
return 0;
--
2.5.3

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

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


Re: [Mesa-dev] [PATCH] nvc0: enable compute support on Fermi

2015-11-05 Thread Ilia Mirkin
On Thu, Nov 5, 2015 at 6:41 PM, Samuel Pitoiset
 wrote:
> Altough the compute support is still not complete because textures and
> surfaces need to be implemented, it allows to launch very simple compute
> kernel like one which reads reading MP performance counters.

Didn't those end up breaking 3d rendering? Have you figured out what
was overwriting what?

>
> This turns on PIPE_CAP_COMPUTE and PIPE_SHADER_COMPUTE.
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 
> b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> index 7d96977..5b7b39b 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> @@ -186,7 +186,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum 
> pipe_cap param)
> case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
>return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
> case PIPE_CAP_COMPUTE:
> -  return (class_3d == NVE4_3D_CLASS) ? 1 : 0;
> +  return 1;

Of course this also enables it for NVF0_3D_CLASS. Pretty sure compute
doesn't work there for some dumb reason (like we're missing some in
our ctxsw fw...)

> case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
>return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ? 1 : 0;
>
> @@ -245,8 +245,6 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen, 
> unsigned shader,
>   return 0;
>break;
> case PIPE_SHADER_COMPUTE:
> -  if (class_3d != NVE4_3D_CLASS)
> - return 0;
>break;
> default:
>return 0;
> --
> 2.5.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev