Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: matlab slow in 3d visualization

Subject: matlab slow in 3d visualization

From: gianni schena

Date: 07 Jan, 2008 14:31:01

Message: 1 of 11


why is matlab so slow in 3d visualization (isosurface,
isonormals, volume rotation in 3d etc) ?

it is Slow even with one of the best graphic cards
(512 Mb gddr3 etc etc & lates drivers )

any idea ?

thank you to all in advance

Subject: Re: matlab slow in 3d visualization

From: Tobias

Date: 08 Jan, 2008 08:26:23

Message: 2 of 11

Which renderer do you use?
Try set(handle_to_figure, 'renderer', 'opengl').

Tobias


> why is matlab so slow in 3d visualization (isosurface,
> isonormals, volume rotation in 3d etc) ?
>
> it is Slow even with one of the best graphic cards
> (512 Mb gddr3 etc etc & lates drivers )
>
> any idea ?
>
> thank you to all in advance

Subject: Re: matlab slow in 3d visualization

From: gianni schena

Date: 10 Jan, 2008 10:54:02

Message: 3 of 11



tobias

set(GCF, 'Renderer','OpenGL');
is already there but rotate is extremly
slow
giaani



Tobias <tc-ng-spam@gmx.de> wrote in message
<5ugqcdF1ig1uuU1@mid.dfncis.de>...
> Which renderer do you use?
> Try set(handle_to_figure, 'renderer', 'opengl').
>
> Tobias
>
>
> > why is matlab so slow in 3d visualization (isosurface,
> > isonormals, volume rotation in 3d etc) ?
> >
> > it is Slow even with one of the best graphic cards
> > (512 Mb gddr3 etc etc & lates drivers )
> >
> > any idea ?
> >
> > thank you to all in advance

Subject: Re: matlab slow in 3d visualization

From: Sridhar Mahadevan

Date: 10 Jan, 2008 15:39:03

Message: 4 of 11

"Gianni Schena" <schena@univ.trieste.it> wrote in message
<fltd35$8p6$1@fred.mathworks.com>...
>
> why is matlab so slow in 3d visualization (isosurface,
> isonormals, volume rotation in 3d etc) ?
>
> it is Slow even with one of the best graphic cards
> (512 Mb gddr3 etc etc & lates drivers )
>
> any idea ?
>
> thank you to all in advance


Which graphics card are you using? I have the same
experience, and posted a note to this newsgroup a few days
ago.

I am using an NVidia 8600GT card with 512MB of DDR3 VRAM,
and the card performs poorly on MATLAB's graphics benchmark
(which does a 3D rotation of the MATLAB symbol).

The card turns in stellar performance on Vista graphics
benchmarks. I don't understand why it is slow in MATLAB
(and a much slower ATI 2400 HD card turns out to be faster
in MATLAB, but slower on Vista graphics benchmarks!).

- Sridhar

Subject: Re: matlab slow in 3d visualization

From: Dan

Date: 15 May, 2008 00:43:03

Message: 5 of 11

My experience is the same with nvidia-based Quadro cards and
an 8800 GT at home for some reason.

My laptop running an ATI mobile GPU is much fast than both
in the bench 3D performance. I cannot understand why and
would like a fix too! :)

"Sridhar Mahadevan" <mahadeva@cs.umass.edu> wrote in message
<fm5e6n$9qj$1@fred.mathworks.com>...
> "Gianni Schena" <schena@univ.trieste.it> wrote in message
> <fltd35$8p6$1@fred.mathworks.com>...
> >
> > why is matlab so slow in 3d visualization (isosurface,
> > isonormals, volume rotation in 3d etc) ?
> >
> > it is Slow even with one of the best graphic cards
> > (512 Mb gddr3 etc etc & lates drivers )
> >
> > any idea ?
> >
> > thank you to all in advance
>
>
> Which graphics card are you using? I have the same
> experience, and posted a note to this newsgroup a few days
> ago.
>
> I am using an NVidia 8600GT card with 512MB of DDR3 VRAM,
> and the card performs poorly on MATLAB's graphics benchmark
> (which does a 3D rotation of the MATLAB symbol).
>
> The card turns in stellar performance on Vista graphics
> benchmarks. I don't understand why it is slow in MATLAB
> (and a much slower ATI 2400 HD card turns out to be faster
> in MATLAB, but slower on Vista graphics benchmarks!).
>
> - Sridhar
>

Subject: Re: matlab slow in 3d visualization

From: tristram.scott@ntlworld.com (Tristram Scott)

Date: 15 May, 2008 09:35:07

Message: 6 of 11

Gianni Schena <schena@univ.trieste.it> wrote:
>
>
> tobias
>
> set(GCF, 'Renderer','OpenGL');
> is already there but rotate is extremly
> slow
> giaani
>
>
>
Which version of MATLAB do you use?

If you have access to some older versions, try 6.5. I find it better for
3d graphics performance (although there are a few bugs which have been
resolved in later versions).

You could also try running with Java disabled. There seems to be some
overhead in the java based figures.

--
Dr Tristram J. Scott
Energy Consultant

Subject: Re: matlab slow in 3d visualization

From: Pasco Alquim

Date: 15 May, 2008 13:03:02

Message: 7 of 11

tristram.scott@ntlworld.com (Tristram Scott) wrote in message
<ftTWj.28967$66.11712@newsfe20.ams2>...
> Gianni Schena <schena@univ.trieste.it> wrote:
> >
> >
> > tobias
> >
> > set(GCF, 'Renderer','OpenGL');
> > is already there but rotate is extremly
> > slow
> > giaani
> >
> >
> >
> Which version of MATLAB do you use?
>
> If you have access to some older versions, try 6.5. I find
it better for
> 3d graphics performance (although there are a few bugs which
have been
> resolved in later versions).

Hi,
It happens the same thing here. R13(6.5) is indeed faster but
its is still 2 to 3 times slower than my 3 years old ATI card


Subject: Re: matlab slow in 3d visualization

From: rych

Date: 16 May, 2008 10:14:26

Message: 8 of 11

On May 15, 10:35 am, tristram.sc...@ntlworld.com (Tristram Scott)
wrote:
>
> You could also try running with Java disabled. There seems to be some
> overhead in the java based figures.
>
Yes, please, how can we disable Java? And how to find out which
functions are java-based. Thanks.
Igor

Subject: Re: matlab slow in 3d visualization

From: tristram.scott@ntlworld.com (Tristram Scott)

Date: 16 May, 2008 16:52:42

Message: 9 of 11

rych <rychphd@gmail.com> wrote:
> On May 15, 10:35 am, tristram.sc...@ntlworld.com (Tristram Scott)
> wrote:
>>
>> You could also try running with Java disabled. There seems to be some
>> overhead in the java based figures.
>>
> Yes, please, how can we disable Java? And how to find out which
> functions are java-based. Thanks.
> Igor

You can pass options to MATLAB on the command line wjhen you start it up.
My favourite is -nojvm. If I need java (e.g. for database toolbox or for
report generator) then I instead use -nodesktop.

matlab -nojvm

I'm not sure of an easy way to list all the java based functions. For the
m files you can look through them with grep, but that won't help with p
files. It also would not find the functions which call these functions.

Perhaps the best way is to turn java off, and then try your code and see if
it fails.

--
Dr Tristram J. Scott
Energy Consultant

Subject: Re: matlab slow in 3d visualization

From: Dan

Date: 23 May, 2008 00:56:02

Message: 10 of 11

OK, I figured out a solution for all of our NVIDIA-based PCs.

A couple of things first though:

- This has nothing to do with running java or not
- This has nothing to do with the renderer really
- This is not an issue of ATI vs. NVIDIA as I earlier speculated

The real problem is that the Quadro and GeForce drivers
(v169.xx) install with Vertical sync ON as the default. This
basically throttles back the GPU so that it only rendered
frames in sync with the refresh rate of your display;
generally removing tearing which occurs when your display
shows midframe between GPU renders.

The Matlab bench algorithm simply turns on shading then
alters the logo math and flushes the buffer with "drawnow"
command. If vsync is on, the CPU is running through the loop
but waiting each time for the gpu to render in sync with
your display when it flushes. In my case this was limiting
to about 60 fps (my LCD is @ 60Hz).

Here is the code:
set(task,'string','3-D')
   drawnow
   pause(1)
   evalc('logo');
   set(logoFig,'color',[.8 .8 .8])
   s = findobj(logoFig, 'type','surf', 'tag',
'TheMathWorksLogo');
   set(s,'facelighting','gouraud')
   L1 = 40*membrane(1,25);
   L2 = 10*membrane(2,25);
   L3 = 10*membrane(3,25);
   mu = sqrt([9.6397238445, 15.19725192, 2*pi^2]);
   n = 40;
   tic
   for j = 0:n
      t = 0.5*(1-j/n);
      L = cos(mu(1)*t)*L1 + sin(mu(2)*t)*L2 + sin(mu(3)*t)*L3;
      set(s,'zdata',L)
      drawnow
   end
   times(k,6) = toc;
   pause(1)
   close(logoFig)


Turn off vsync in the nvidia control panel by setting
advanced 3d settings option there to FORCE OFF.

I notice no tearing in anything I do but drastically
increased 3D bench scores which absolutely kill the ATI
cards I have.

I hope this helps!

"Gianni Schena" <schena@univ.trieste.it> wrote in message
<fltd35$8p6$1@fred.mathworks.com>...
>
> why is matlab so slow in 3d visualization (isosurface,
> isonormals, volume rotation in 3d etc) ?
>
> it is Slow even with one of the best graphic cards
> (512 Mb gddr3 etc etc & lates drivers )
>
> any idea ?
>
> thank you to all in advance

Subject: Re: matlab slow in 3d visualization

From: Aleks

Date: 17 Jun, 2008 13:45:03

Message: 11 of 11

The "bench" got about twice as fast with vsync disabled,
thnx

"Dan " <daniel.salluce@ngc.com> wrote in message <g154n2
$8mg$1@fred.mathworks.com>...
> OK, I figured out a solution for all of our NVIDIA-based
PCs.
>
> A couple of things first though:
>
> - This has nothing to do with running java or not
> - This has nothing to do with the renderer really
> - This is not an issue of ATI vs. NVIDIA as I earlier
speculated
>
> The real problem is that the Quadro and GeForce drivers
> (v169.xx) install with Vertical sync ON as the default.
This
> basically throttles back the GPU so that it only rendered
> frames in sync with the refresh rate of your display;
> generally removing tearing which occurs when your display
> shows midframe between GPU renders.
>
> The Matlab bench algorithm simply turns on shading then
> alters the logo math and flushes the buffer with "drawnow"
> command. If vsync is on, the CPU is running through the
loop
> but waiting each time for the gpu to render in sync with
> your display when it flushes. In my case this was limiting
> to about 60 fps (my LCD is @ 60Hz).
>
> Here is the code:
> set(task,'string','3-D')
> drawnow
> pause(1)
> evalc('logo');
> set(logoFig,'color',[.8 .8 .8])
> s = findobj(logoFig, 'type','surf', 'tag',
> 'TheMathWorksLogo');
> set(s,'facelighting','gouraud')
> L1 = 40*membrane(1,25);
> L2 = 10*membrane(2,25);
> L3 = 10*membrane(3,25);
> mu = sqrt([9.6397238445, 15.19725192, 2*pi^2]);
> n = 40;
> tic
> for j = 0:n
> t = 0.5*(1-j/n);
> L = cos(mu(1)*t)*L1 + sin(mu(2)*t)*L2 + sin(mu(3)*t)
*L3;
> set(s,'zdata',L)
> drawnow
> end
> times(k,6) = toc;
> pause(1)
> close(logoFig)
>
>
> Turn off vsync in the nvidia control panel by setting
> advanced 3d settings option there to FORCE OFF.
>
> I notice no tearing in anything I do but drastically
> increased 3D bench scores which absolutely kill the ATI
> cards I have.
>
> I hope this helps!
>
> "Gianni Schena" <schena@univ.trieste.it> wrote in message
> <fltd35$8p6$1@fred.mathworks.com>...
> >
> > why is matlab so slow in 3d visualization (isosurface,
> > isonormals, volume rotation in 3d etc) ?
> >
> > it is Slow even with one of the best graphic cards
> > (512 Mb gddr3 etc etc & lates drivers )
> >
> > any idea ?
> >
> > thank you to all in advance
>

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
vsync nvidia bench 3d slow Dan 22 May, 2008 21:00:09
graphics Sridhar Mahadevan 10 Jan, 2008 10:40:18
graphic board Gianni Schena 10 Jan, 2008 05:55:10
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics