Multithreading + OpenGL

Started by
15 comments, last by vNistelrooy 18 years, 7 months ago
Quote:Original post by Shannon Barber
I'd be interested in how this turns out, I did some test with threaded rendering before, but switching an OGL context in and out is a very expensive operation.


Yes, for each thread I make the context current once and use EXT_framebuffer_object for rest of the processing.

Phantom:- Where did you find those GDC05 presentation. Could you please post the link here ?

Omaha:- How do I know whether the system has SMP-drivers ?
Advertisement
Quote:Original post by dimensionX
How do I know whether the system has SMP-drivers ?

if(ActiveCPUs() > 1 && DoesntCrash())
smp_drivers = true;
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Quote:Original post by dimensionX
Quote:Original post by Shannon Barber
I'd be interested in how this turns out, I did some test with threaded rendering before, but switching an OGL context in and out is a very expensive operation.


Yes, for each thread I make the context current once and use EXT_framebuffer_object for rest of the processing.



what are you processing if i may ask? (renderfarm?)

System Configuration:-
--------------------
1) '2' AMD Opteron 64-bit processors
2) '2' Geforce 7800 GTX GPUs (NOT connected in SLI)
3) '4' VGA Monitors, 2 monitors to each graphics card (Horizontal span mode) i.e I have to 2 horizontal spans one on each graphics card. I had also disabled Vsync for both cards. Each horzontal span is (2048 * 768). Also for the 2nd horizontal span, I set it to extended desktop mode.

Situation:- (Refresh rates are set to 60Hz)
---------
1) Horizontal Span + Extended desktop mode + GLUT window size (4096 * 768)
FPS = 20

2) Horizontal Span + Extended desktop mode + GLUT window size (2048 * 768) - window doesn't cross the 1st GPUs boundry. FPS = 20

3) Horizontal Span + Extended desktop DISABLED + GLUT window size (2048 * 768)
FPS = 45

My FPS halves when I use extended desktop mode (although my window does not span the 2nd GPU, CASE 2). So I guess it is not the problem of loosing hardware acceleration when using multiple GPUs. I cannot bring down the refresh rates.

How can I get around this problem ?
Solved the problem partly. It was the glTexSubImage2D call that was the killer.

Now I have another problem. My current version works with Win32 with WS_OVERLAPPED | WS_VISIBLE. When I try the WS_POPUP for fullscreen on both horizontal spans, my fps severly drops. Also I am using glewInit(). I call it once per window since each window maps to a different GPU. I hope the multithreading is not the issue with glewInit()
btw how exactly do you go about assigning each thread to each cpu


im assuming you are using beginthread((void *)funct(void),size_t,(void *)arg);
??? (process.h)
Affinity masks.
"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

This topic is closed to new replies.

Advertisement