Jump to content
9 posts in this topic

Recommended Posts

Hi there,

 

I have an issue with slow bandwidth in OpenCL on my SnowLeopard OSx86. First I thought it was NVIDIAs fault something with the driver etc. So I decided to compile it with OpenCL framework provided by apple taking the files from NVIDIAs sdk and building the application.

 

I get this rather result which seem to say that there is a problem on how OS X treats my GPU card (GTX-275 1792MB) :

--------------------------------------------------------------------

./oclBandwidthTest64 Starting...

 

WARNING: NVIDIA OpenCL platform not found - defaulting to first platform!

 

Running on...

 

GeForce GTX 275

 

Quick Mode

 

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 2243.4

 

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 2343.1

 

Device to Device Bandwidth, 1 Device(s)

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 6134.7

 

 

PASSED

 

 

Press <Enter> to Quit...

-----------------------------------------------------------

 

Since I am interested in making my machine workable with GPGPU it is necessary that the first two approach 4GB/sec and the last to exceed 100GB/sec

 

So I am attaching two files the first is 64bit (oclBandwidthTest64) the second 32bit(oclBandwidthTest32) so as for you to test it and post the results here suggesting also, if you can, what I should do in order to fix this situation.

 

Alex.

oclBandwidthTest.zip

Link to comment
https://www.insanelymac.com/forum/topic/241845-opencl-slow-bandwidth/
Share on other sites

Noone is interested in OpenCL? It is a simple program to run just go to the console and type the executable. :-)

 

The matrix multiplication example of NVIDIAs SDK seem to be working ok. I get 220ms execution time. Of course it is around 2 times slower than Linux 120ms. If the memory bandwidth transfer was 6GB/sec Matrix Multiplication would be deadly slow. Also OpenGL is extremelly slow using NVIDIAs sdk since it goes from the host.

 

Are there any OpenCL benchmarks to test OpenCL + OpenGL on the OS X?

 

Alex.

Never mind it is a bug, NVIDIA is using the Linux version to get the time which is not correct for OS X.

Here are the actual results:

 

./oclBandwidthTest64 Starting...

 

WARNING: NVIDIA OpenCL platform not found - defaulting to first platform!

 

Running on...

 

GeForce GTX 275

 

Quick Mode

 

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 2313.8

 

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 2398.0

 

 

Memory Transfer took 0.046580 seconds using C clock_t

Memory Transfer took 1.068621 seconds using Nvidias clock

Device to Device Bandwidth, 1 Device(s)

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 137398.0

 

 

PASSED

 

 

Press <Enter> to Quit...

 

These results are correct.

 

Alex.

For those who want to see the correct Bandwidth of their card and cpu I am attaching the correct files. Only the Direct mode is correct.

 

Here are my results which look reasonable.

 

localhost:oclBandwidthTest agalex$ ./oclBandwidthTest64 --device=0

./oclBandwidthTest64 Starting...

 

WARNING: NVIDIA OpenCL platform not found - defaulting to first platform!

 

Running on...

 

GeForce GTX 275

 

Quick Mode

 

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 3056.9

 

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 3095.0

 

 

1048576

Device to Device Bandwidth, 1 Device(s)

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 166579.9

 

 

PASSED

 

 

Press <Enter> to Quit...

-----------------------------------------------------------

 

localhost:oclBandwidthTest agalex$ ./oclBandwidthTest64 --device=1

./oclBandwidthTest64 Starting...

 

WARNING: NVIDIA OpenCL platform not found - defaulting to first platform!

 

Running on...

 

Intel® Core i7 CPU 920 @ 2.67GHz

 

Quick Mode

 

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 4480.5

 

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 4492.7

 

 

1048576

Device to Device Bandwidth, 1 Device(s)

Transfer Size (Bytes) Bandwidth(MB/s)

33554432 8699.8

 

 

PASSED

 

 

Press <Enter> to Quit...

-----------------------------------------------------------

 

Cheers,

Alex.

oclBandwidthTest.zip

Video card:

GeForce 9800 GTX/9800 GTX+

Quick Mode

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			9268.4

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			9080.2


1048576
Device to Device Bandwidth, 1 Device(s)
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			230249.0

Hostdevice bandwidth is 3 times higher than yours!

 

CPU:

Intel(R) Core(TM)2 Duo CPU	 E8500  @ 3.16GHz

Quick Mode

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			3186.0

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			3224.9

Device to Device Bandwidth, 1 Device(s)
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			6351.5

Are there any OpenCL benchmarks to test OpenCL + OpenGL on the OS X?

Courtesy mitchde:

http://www.insanelymac.com/forum/index.php?showtopic=182874

 

oclinfo: http://www.insanelymac.com/forum/index.php?showtopic=170796

Video card:

GeForce 9800 GTX/9800 GTX+

Quick Mode

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access
Transfer Size (Bytes)	Bandwidth(MB/s)
33554432			9268.4

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access
Transfer Size (Bytes)	Bandwidth(MB/s)
33554432			9080.2


1048576
Device to Device Bandwidth, 1 Device(s)
Transfer Size (Bytes)	Bandwidth(MB/s)
33554432			230249.0

Host<->device bandwidth is 3 times higher than yours!

 

CPU:

Intel(R) Core(TM)2 Duo CPU	 E8500  @ 3.16GHz

Quick Mode

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access
Transfer Size (Bytes)	Bandwidth(MB/s)
33554432			3186.0

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access
Transfer Size (Bytes)	Bandwidth(MB/s)
33554432			3224.9

Device to Device Bandwidth, 1 Device(s)
Transfer Size (Bytes)	Bandwidth(MB/s)
33554432			6351.5

 

Courtesy mitchde:

http://www.insanelymac.com/forum/index.php?showtopic=182874

 

oclinfo: http://www.insanelymac.com/forum/index.php?showtopic=170796

 

No its not correct it can't be 9GB/sec. Thanks for posting your results. Only in asynchronous mode it can reach close to 8GB/sec but never exceed it. The CPU sounds reasonable though (if you have a DDR2-800 or DDR3-800 memory) this would mean that there is no bug. I am getting the time with double(t1-t2)/CLOCKS_PER_SECOND. CLOCKS_PER_SECOND is 10e6 in my case could it be different in your case? I will post the code also here so that someone can compile it with his/her machine.

 

Unzip the file in a Directory and type this in the console window.

 

g++ -I./ *.cpp -framework OpenCL -o BandwidthTest

 

then simply type ./BandwidthTest

 

One thing is for certain because NVIDIAs version was tested on MacBook, it gives erroneous results. Build the application and test it compiled in your machine. I am curious my results in GPU are reasonable, why not yours...

 

Alex.

BandwidthTest.zip

I have DDR2 1066 Memory.

 

It compiles but spits out this:

 

shrUtils.cpp: In function ‘int shrLogV(int, int, const char*, __va_list_tag*)’:

shrUtils.cpp:416: warning: format not a string literal and no format arguments

shrUtils.cpp:420: warning: format not a string literal and no format arguments

shrUtils.cpp:423: warning: format not a string literal and no format arguments

 

GPU:

GeForce 9800 GTX/9800 GTX+

Quick Mode

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			8525.6

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			8503.8

Device to Device Bandwidth, 1 Device(s)
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			229029.5

GPU looks more realistic now, according to what you said.

 

CPU:

Intel(R) Core(TM)2 Duo CPU	 E8500  @ 3.16GHz

Quick Mode

Host to Device Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			3161.3

Device to Host Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			3237.0

Device to Device Bandwidth, 1 Device(s)
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			6370.1

I have DDR2 1066 Memory.

 

It compiles but spits out this:

 

shrUtils.cpp: In function ‘int shrLogV(int, int, const char*, __va_list_tag*)’:

shrUtils.cpp:416: warning: format not a string literal and no format arguments

shrUtils.cpp:420: warning: format not a string literal and no format arguments

shrUtils.cpp:423: warning: format not a string literal and no format arguments

 

GPU:

GeForce 9800 GTX/9800 GTX+

  Quick Mode

  Host to Device Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			8525.6

  Device to Host Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			8503.8

  Device to Device Bandwidth, 1 Device(s)
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			229029.5

GPU looks more realistic now, according to what you said.

 

CPU:

Intel(R) Core(TM)2 Duo CPU	 E8500  @ 3.16GHz

  Quick Mode

  Host to Device Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			3161.3

  Device to Host Bandwidth, 1 Device(s), Paged memory, direct access
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			3237.0

  Device to Device Bandwidth, 1 Device(s)
  Transfer Size (Bytes)	Bandwidth(MB/s)
  33554432			6370.1

 

As I told you the memory bandwidth/channel is correct for the CPU, per channel in order to test DDR3 you have to three memory allocations and feed the memory simultenously or if you have DDR2 two memory allocations. The memory bandwidth of the GPU you have is interesting it should not exceed 80GB/sec the device to device and the Device<->Host not exceed 3.5GB/sec. About the warnings do not take them in consideration, nothing to worry about. This is magic right? Knowing the architecture of your machine is crucial. With OpenCL you can take advantage of the full bandwidth of the memory<->processor bus by feeding it simultenously with data. Not to mention Kernel execution. There you can play with the local cache in a uniform way with OpenCL. Still though you need to know the amount of data to transfer thus know the architecture and know how much data to prefetch to the local memory in GPU and CPU. Yes you can have the theoretic 25GB/sec but it is peanuts compared to what you can do inside the processor in a uniform as I told way as the GPU. OpenCL just gives you a common way that treats the architecture of your Hardware. The rest is up to the programmer to know how OpenCL maps to the architecture.

 

Alex.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...