Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I implemented a RNS Montgomery exponentiation in CUDA and on CPU for comparison.

Everything nice everything fine. It runs on just one SM. However, I am going to tell you some strange regression in both CPU/GPU performances.

During the developing, about two months ago, I was using CUDA 5 preview on Ubuntu 11.04 64bit. In this time, I reach the following performances:

CPU 460ms GPU 120ms

Then one day, when I turn on the PC, the graphical environment didn't start. I don't know which was the problem, however I switched to the console and installed again the CUDA driver. At the following boot performances changed:

CPU 310ms GPU 80ms

I was wondering how that could be possible.

However, I went then in holiday for 10 days and I continued developing and optimizing on my notebook (but not the same part of the code, some additional stuff).

When I was back, I just updated the source files, and performances came back to 460/120ms. I couldn't believe it, I tried to install CUDA 5 RC, updating the video driver too. Nothing changed. I checked Debug/Release, CUDA computability, but the problem seems being somewhere else.

Looking around the net I found this, I am pretty sure it must have something to do with the driver, because the performance change affected both CPU and GPU

Do you have some tips/ideas/suggestions?

share|improve this question
I'm pretty sure this is a way better fit on SO. Also, if you changed the code again in the interim, the test for "regression" is invalid. –  hbdgaf Aug 28 '12 at 16:32
@aking1012 Please sorry but I dont get you, could you explain me better what you mean exactly? –  elect Aug 29 '12 at 18:39
general programming questions are a better fit on stackoverflow. if you changed code and the benchmark changed back, there is no way to determine if your "optimization" is at fault or if it is some driver regression. you would need to test the exact same code. –  hbdgaf Aug 29 '12 at 18:50
add comment

closed as off-topic by Braiam, guntbert, psusi, Eric Carvalho, Radu Rădeanu Oct 20 '13 at 15:13

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – Braiam, guntbert, psusi, Eric Carvalho, Radu Rădeanu
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

If I understood well, you got the better performance in text mode. That would be quite obvious, as no GUI was used.

But anyways. First of all, check if your compielr uses the newest source files. As you have switched only source files, it is possible that object files are still in the folders. If so, it might happen that the compiler won't compile the new sources, as it sees already created object files.

The second (maybe dumb) suggestion is to check what compiler options you use. Maybe last time you have added one more switch to compiler command line?

The third possible issue is that your code is better optimized at some level than on the other. For example, it sometimes happen that for example -O3 optimization level gives slower code than -O2 (on GCC). What I mean is that not every level of optimization is suitable for every algorithm.

Another possible issue: check what driver do you choose for CUDA compilation. In documentation you can see CUDA 4.0, CUDA 5.0, "bare" driver and so on. Experiment with this settings a litte.

And the last thing that comes to my mind: maybe some change in system settings influencing GPUs has been done or some deamon or utility was turned off while testing.


PS.: If nothing helps, I would suggest posting this on CUDA forums.

share|improve this answer
No, when I had a crash of the graphic environment, then I reinstalled the nvidia Cuda driver 5.08 and then I had better performances. However I tried in text mode as you suggested, performances on cpu are slightly better, 410ms, but since not the 370ms. Regarding the other tips, no option compiler were changed. I tried -o1, -o2 and -o3, but no big changes. I did all this with the Cuda 5.0 Preview. Now I updated to the RC but nothing changed. I had opened just the browser, skype and few pdf, again no changes. Unfortunately the CUDA forums are down. However the performances difference affected –  elect Aug 29 '12 at 18:37
both the cpu and the gpu. This is why I think is something wrong with the interaction between the CUDA driver and the OS... I just noticed that my /etc/modprobe.d/blacklist is empty, shouldnt I have the noveau written there? @Misery –  elect Aug 29 '12 at 18:38
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.