Results

nVidia CUDA, nVidia Optimus, Linux & their complex relationship


After months of brainstorming on whether to get a Macbook or a Win7 laptop, how and where to buy it, what configuration to choose etc, I finally got my new Alienware M14x (Win 7) last week. Unfortunately I got my hands on it last Monday, which in my opinion left me no choice but to reduce my sleeping hours to 3-4hrs a day. With all those extra ‘sleepless’ hours I managed to find, I could accomplish quite a lot of things I had in my rather long TODO list by the end of the week, or so I thought. But I still haven’t completely set up my system, the way I wanted – lots of games, a Linux development environment etc.

The culprit is none other than the most important component in the laptop (for me) - the GPU. Since gaming, photo editing and GPU programming (nVidia CUDA) are the three things I am looking forward to focus on for most of my time, I wanted to make sure I made the right choice in selecting the GPU. The M14x comes with an nVidia GeForce GT 555M and it boasts the nVidia Optimus technology which uses switchable graphics (with Sandy Bridge integrated GPU) for power saving. All the reviews explained a lot about how this laptop takes full advantage of Optimus. But what none of the posts (I read) mentioned was, just like any other new technology, there is no support for Optimus in Linux till date, not by nVidia, not by Linux or not even by the manufacturer (in my case, Dell/Alienware).

What this means is, even though I will be able to use the nVidia GPU in Linux for CUDA programming, I won’t be able to use the nVidia GPU for any graphics applications in Linux. For example, I will be able to do computations on the GPU as a coprocessor, but it cannot be used for display in Linux environment. It doesn’t affect me a lot as I am not looking forward for any graphics programming in Linux in the short term, I already have my hands full with the TODO list I mentioned earlier. But it sure is a bummer considering I wanted to try out some graphics/game programming in the long term in the Linux environment. Hopefully there will be support for the Optimus technology in Linux soon.

I learned this fact the hard way, after spending long hours trying to setup my system to use the nVidia GPU. This post may/may not offer any solutions to any particular problem, but just a few observations and links to some of the sites/forums that helped me in the process.

To begin with, my requirement was to be able to do CUDA programming on a Linux environment in my M14x (GT 555M). On a side note, I have done CUDA setup & programming in the past and was familiar with it. My first step was to choose one of the Linux distributions supported by CUDA. I chose Ubuntu 10.10 and installed it. During my first boot, it asked me to upgrade to 11.04, which I did not accept because I knew that gcc 4.5 or above is not supported by CUDA at the moment. Ubuntu also asked me to activate the nVidia driver which I did it. Then I downloaded the CUDA dev driver, toolkit 4.0 and the code samples. I rebooted the machine and the Xserver failed to start. So, from the command prompt, I removed the ubuntu supplied driver.

sudo apt-get --purge remove nvidia*

Then I installed the dev driver downloaded from nVidia site.
Chmod +x "filename"
./"filename"

I also installed the toolkit (also set the path), samples and the required libraries for building them as specified in the CUDA Getting Started Guide (Linux). I rebooted the machine and again the Xserver failed to start. I poured through support forums & blog entries, tried the black listing method, reinstalled various drivers etc. None of them worked. Ubuntu was unable to load Xserver. So I decided to reinstall Ubuntu and start from step 1.

This time I was more cautious, I did one step at a time. But the moment I installed the dev driver and reboot, Xserver stopped working. What perplexed me more was, I was still able to run the CUDA binaries, which means the driver is installed properly. For a moment, I considered giving Fedora 13 a try.

That’s when I realized that I am using Optimus technology and the thought crossed my mind that what if Linux is trying to use the integrated GPU and nvidia driver is conflicting. My heart sank when I found out that there is no support for Optimus in Linux. There is third party software called bumblebee, which didn’t work for me. Some of the posts talks about a BIOS setting which can force either of the GPUs rather than switching them dynamically. But M14x BIOS doesn’t have that option, yet. So, I was out of options and that when this post helped me. It helped me deactivate the nVidia driver and use the integrated GPU for Xserver. Also the GPU is detected as a coprocessor so that I can do my CUDA programming as long as I am not playing with graphics. Remember to update the Intel graphics driver.
sudo apt-get install xserver-xorg-video-intel

In a nutshell, if your laptop is equipped with Optimus, better use the integrated graphics as of now for Linux. It’s a shame that so much GPU power is simply wasted.

Singapore 101: Riding in Singapore


Update: This post is the first among my Singapore 101 series where I hope to provide some basic information about various aspects of an expat lifestyle in Singapore.

It’s been around one and a half years since I started riding my Honda Phantom 200cc (motorbike) which is my first two wheeler in Singapore (overall 3rd one). Over the years, I get a lot of general questions about owning and riding a motorbike/two wheeler in Singapore. I would like to share some information which I learned after started riding here, which (I hope) will help a foreigner start riding in Singapore.

Pros & Cons
Before going to the details, here are some of the pros and cons of owning a two wheeler in Singapore.

The Good: Convenience & Cost Effectiveness - Even though Singapore boasts one of the best public transportation systems in the whole world, it can get really crowded during peak hours. During after hours, there is no public transportation at all when one has to depend on taxis which can get super expensive. Depending on the distance travelled, public transportation can sometimes get costly also. Having a two wheeler eliminates all of the above obstacles like long waiting periods for a bus or avoiding a traffic jam (which doesn’t affect a two wheeler as much as it affects a four wheeler).

The Bad: Climate - Since Singapore is a tropical country, it can rain anytime and it’s almost impossible and extremely dangerous to ride in rain. Fortunately, the rains here don’t last long.

The Ugly: Fatality - One small mistake can lead to far more serious consequences.

Getting a license
There are three classes of licenses to ride a two wheeler in Singapore.
1. Class 2B – To ride a two wheeler up to 200cc
2. Class 2A – To ride a two wheeler up to 400cc
3. Class 2 – To ride a two wheeler more than 400cc

To start with, one has to get a Class 2B license. To get a 2A license, one has to be a class 2B license holder and should not have more than 12 (traffic) demerit points for one year from the day he/she gets the 2B. (I am not sure about the details of demerit points. Also, it’s the same procedure for getting a class 2 license after getting a class 2A). To get a 2B license, one has to pass a theory exam, a test circuit (which comprises of obstacles like a narrow plank, crank course, pylon slalom, emergency braking etc) and a road test. For class 2A & 2, there is only a circuit test as you are supposed to know the basics of riding (both theory & practical road riding) already.

Before attending the test, one has to enroll in one of the three driving schools in Singapore and attend  various sessions. For example, for the 2A course, one has to attend 3 practical & 1 theory sessions. At the end of each class, the instructor has to certify the candidate is ready to attend the next class. Only after successfully completing the 3 classes that the candidate can appear for the exam. 

There is an option to convert an existing license from a person’s country of origin to an equivalent class (which I did) which will require one to write only a theory exam. For an Indian two wheeler license, up on conversion, you will receive a class 2B license. To receive class 2A & 2, one will have to go through the process described above.

p.s. Just getting a license is not enough for a person to ride a two wheeler, say a friend’s motorbike. He/she needs to have insurance for that particular vehicle.

Getting a two wheeler
One can either choose to get a brand new two wheeler or a used one depending on their specific needs. Different types of two wheelers include scramblers, sports bikes, cruisers, roasters, cubs etc. To register a two wheeler (in the case of a used one), all a person have to do is to go to the LTA office in Sing Ming Avenue with the owner (or his/her ID). It takes only around 5 minutes to complete a form and pay the fee.

General Tips & Information
Renewal of road tax & insurance, getting the vehicle inspected from an approved inspection center, routine maintenance etc are some of the other procedures which comes as a package with owning a two wheeler.

More information about owning a two wheeler can be found in the following links
http://www.singaporebikes.com/forums/showthread.php/164254-RE-quot-Help-me-choose-bike-pls!-quot

If you find a mistake in the post or if there is any critical information missing, please leave a comment.

Compassion


I watched this commercial for the first time, around a month back, when my friend shared it in Facebook. It was after my dinner on one of those hectic days, when all I wanted was to get my mind off everything else. So I was lazily browsing FB and I clicked on this video. At first, the music caught my attention. It was slow and relaxing. Slowly, the commercial got my full attention. By the time I finished watching it, I realized my eyes were filled with tears and I felt heavy at heart.
At first I told myself, “It’s just a silly commercial, you will grow over it”. But every time I watch this, it feels heavier.
Here, I am talking no more, decide for yourself!


“There are no perfect fathers, but a father will always love perfectly”


“When life is full of misery, what do we do most?”

Expedition to a Volcano

“…Isn’t like that?” my colleague asked me.
“Uh! Umm, I think so”, I replied, even though I had no clue about what he was talking.
He understood it. “Hey man, you are not listening, where are you, actually?” were his next words.
He was right, I was not there. Even though its almost a week since my last trip, I was finding it difficult to get back to the ‘real world’.
It all started when we (me and my better half) figured out that our ‘party stocks’ are nearing its completion. In order to stock up in ‘large volumes’, we needed access to the duty free shops in the airport. That’s when our friends Jaiwin & Aneesh told us about a trip, some of their friends were planning. “A weekend in a ‘not-so-heard-about’ place in Indonesia with a bunch of ‘not-much-known-before’ people” – that pretty much summarizes our impression about the trip. ‘Never-say-no-to-travel’ being our motto, we immediately signed up for it. It turned out to be one of the most memorable trips in our lives, both because of the place we visited and the new ‘company’ we discovered.
As the trip dates neared, I wanted to get some information about the previously unheard location - Bromo-Tengger-Semeru National Park, East Java, Indonesia. Wikitravel writes, “If a landscape was ever needed to demonstrate the meaning of the phrase desolate beauty, then this is surely it. Rugged, barren volcanic peaks, gravel plains and that sea of sand, truly unworldly” and it’s true to every single word. The main attraction is to watch the sunrise from Mount Pananjakan with the active volcanoes Mount Bromo & Mount Semeru and the Mount Batok in the back drop.
We started from Singapore around 8pm on a Friday and reached Surabaya airport around 11pm local time. Special thanks to our trip organizer - Balaji - and the location specialist – Ajay – for arranging everything. We started our journey to Mount Pananjakan right away as we wanted to be there for the sunrise. We had to change to 4x4 jeeps in between, which took us to the view point just in time for the sunrise. Even though a small crowd was already there, we managed to find a good spot at the tip of the view point.

Both the pre-dawn sky and the sunrise were breathtaking experiences

That’s us, with the mighty volcanoes in the backdrop

After the sunrise, we began our journey towards Mt. Bromo

We traveled through the Sea of Sand (literally)…

…towards the Poten Hindu temple which is the gateway towards Mt Bromo’s crater

From there, we climbed for around an hour towards the Bromo crater. This is not a place for anyone who has problems with dust. As the atmospheric temperature rises, heavy sandy winds mixed with volcanic ash makes you somehow want to get out of there.

But the raw beauty of nature makes you want to stay even more. If you are lucky enough, you can witness the mountain puffing out volcanic smoke from it’s under belly.

By the time we reached back the bottom and back to the ‘base camp’, we were extremely tired and hungry from to the lack of sleep and the trek/travel. After some ‘light refreshments’ from a nearby shop – after which, the shop was closed for the day - we started our journey back to Surabaya where our stay was arranged.
After checking in and some initial rest, we all got together at the infamous ‘room 231’ where later we all took the ‘oath of secrecy’ that whatever happened there, will be buried with us in our graves.
The next day we explored Surabaya town. We visited the Semporna museum where the major focus is given to the influence of tobacco in Indonesian culture.

We also visited an old church (I am not very sure of its significance)

After that, we pretty much walked around the town on our own, taking photos and enjoying the company of the locals. We headed back to our rooms before very late as we had an early morning flight to catch the next day. (What happened to all of us that last night also comes under our ‘oath of secrecy’ and is still a ‘highly controversial’ topic)
Next day, we boarded our flight back to Singapore, with our newly made friends, the still fresh smell of the volcanic ash and with the satisfaction of having known one of the most polite people in the whole world. No wonder, even after one week, I am unable to find my ‘balance’ with the so called ‘real world’ life!


Movie in 2 mins: “Mere brother ki Dulhan” (My brother’s fiance)

I am not a big fan of romantic comedies/musicals and I try my best to avoid one, especially the Bollywood ones. Within the first few minutes, any sane person can guess the whole story, down to the very fine details - predictability. At times, I make exceptions and watch them, usually when I am with my friends.
Last Sunday was one such occasion. I was visiting some friends and they suddenly planned for this movie - Mere brother ki Dulhan (My brother’s fiance). The moment I heard the name of the movie, I guessed the storyline. But when I found that the protagonist is played by Imran Khan, I was a bit hopeful. After all, his movies made me laugh (most of the times).
As expected, the story line was very clear within the first 10 minutes. Like the name ‘suggests’, the hero will fall in love with his brother’s fiancé. Since it’s a romantic Hindi movie, there MUST (keyword here is MUST) be a happy ending. There I was, watching a movie which I always try to avoid, because it’s just a waste of time. Even then I thought there will be something different, something which is not so obvious about the movie.
What I didn’t realize was the movie was so full of clichés and songs, even beyond my ‘wildest imaginations’. Read the following ‘quick replay’ in a ‘problem-solution’ format and decide for yourself whether any of these events sounds familiar.
Starting problem: Hero’s brother wants hero’s help to get married and settle down.
Solution: Hero goes on ‘bride-hunting’ for his brother, ends up at his old acquaintance (heroine – who rocks in looks and character). Their families also agree on the alliance.
New problem: Heroine wants to enjoy the last few hours, how can she?
Solution: Hero saves the hour and they have a great time together.
New problem: They fall in love (Aha!). Now, how will they make hero’s brother call off the wedding without embarrassing themselves?
Solution: Get hero’s brother’s old girl friend to flirt with hero. Seeing this, hero’s brother gets jealous and decides to run away with his old girl friend.
New problem: How will the family avoid the embarrassment?
Solution: Family asks our hero to marry the heroine.
And this whole thing goes with a north Indian wedding setting in its backdrop, with a song every 5 minutes (literally).
And so the Bollywood proved me wrong, again. I thought no one will watch the same old ‘winning Indian romantic movie formula’ after some time. After this movie I said to myself, that time has yet to come.
p.s. I didn’t give a spoiler warning as there is nothing ‘unpredictable’ to spoil.

Sabah: An experiment from God

According to the popular travel guide Lonely Planet, Sabah is the result of an experiment from God. It goes on like this, “After the first six days of work (creation), instead of resting, He wanted to see what happens if He takes an island, covered it with impenetrable jungle, add lot of new life forms and turned the temperature up to 40 deg C. The result is the ‘tropical Eden’ of Sabah”. In my opinion, to His test tube He also added some kind of “over-sizing” portion so that everything is either the biggest or the largest in the area.

Mt. Kinabalu – one of the tallest mountains in Southeast Asia is located in Sabah. On the other side of the state are the seductive blue coral reefs of Sipadan, also called ‘The Diver’s Mecca’. One of the world’s incredible cave systems and karst formations can be found in Gunung Mulu National Park in Sarawak, the other state of Borneo (UNESCO world heritage site). Borneo is also home to the largest flower in the world – Rafflesia, the largest living arboreal animals – Orangutan and the list goes on and on.

Even though, I wanted to visit Sabah for the above stated reasons, none of the above was the actual reason I made my first visit to Kota Kinabalu last week. Two of my ‘self-proclaimed mountaineer’ friends were visiting the place for the sole purpose of ‘conquering Mt Kinabalu’ and exploring the Mulu caves (around 10days). Being a travel enthusiast, I immediately agreed on meeting them. Since everything was last minute, I couldn’t cater time for conquering the mountain or exploring the caves or diving with the sharks (yeah, sharks are the major attraction of Sipadan). So I decided to use this trip as a survey trip for planning the future expeditions. Also, this trip was different from my usual trips as I concentrated on ‘less traveled paths’ and of course, spending time with my friends and concentrating more on my photography skills.

Our stay - Hotel Jesselton, KK. Jesselton was the name of KK during the colonial period. Located at Gaya St. – still cobbled, another remnant of colonial rule

 Night markets of KK - Great place to spend time after dinner if you are a shopaholic, especially because there is a lot of room for bargaining.

 Handicrafts market in KK - It was too late by the time we reached there and most of the shops were closed. These shops will give you a peak in to the rich culture Borneo has to offer.

‘Street dining’ in KK – One can discover the local cuisines in its authentic form here
 We started our jungle/river boat ride from here. Located near a tropical reserve, this place is home to some of the unique species of flora and fauna.

The boat ride through the calm river during sunset was so relaxing

A lot of tourists – especially those from non-tropical countries seemed very curious about wild monkeys and got very agitated whenever one was sighted.

 A ‘family reunion’

 King of the trees -
During our jungle trek near the Mt. Kinabalu national park, the local guide pointed out this particular tree to be known as the king of trees

 Hanging Bridge Canopy walk – The view down below is overwhelming, but I wouldn’t recommend this for those who are afraid of heights and also afraid of walking on a ‘rope’.

 Nature at its best - After the trek we visited the poring hot springs. I have no idea why they call it hot springs when the water is cold and chilly. All my tiredness from the trek just vanished after a bath in the ‘natural’ pool.

 Mount Kinabalu hiding behind the clouds. A view from Pine Resorts near the national park

By the time we returned, the clouds were up on us and the air was chilly. Our guide had a hard time driving through the S-shaped roads.

 Sunday market in Gaya St. I found all sorts of interesting things in these shops. Both visitors and locals were shopping with equal enthusiasm

For Sale - A kitty in a pet stall in the market

Even though I spent around 3 days there, I parted with the feeling that I hadn’t even 'scratched the surface' of all the things I could do there – all the surprises Borneo holds. As my return flight was taking off, I was busy making a mental note of all the things I should do during my next visit.

Windows vs. Mac – My 10 cents to the age-old debate

Well, how should I start this one? I am not surprised if your thoughts after reading this post’s title go something similar to this, “uh! Not one more of these never ending, 15 year old debate”. Also, there is a high chance you already have your own strong ‘opinions’ about both platforms. I am merely trying to add my own 10 cents to it.

My work – because of its ‘complexity’ – makes it a necessity for me to be well versed with Windows & Linux. Since MAC provides a Linux-similar development setup and Windows similar user environment in one box, my office issued me a Macbook Pro. Being a self-proclaimed gadget geek, I wanted to review it then itself. Later I decided against it thinking its better to wait a bit more and get to know the new toy.

Steve Jobs and his company sure know how to make users feel great. ‘Feel great’ is actually an understatement. The feeling of using a Mac is different. It’s not like using a PC, which is just another tool to check mails or get jobs done. With Mac, the whole ‘computer experience’ is different. Its simply different – in an awesome way. That’s the first and the most important thing I felt after using a Mac. By user experience, I mean whatever the user is directly in contact with - the touchpad or the display or the sound or the cool looks & feel.

I am a person who shuts down my windows pc/laptop after I use it, or else the whole system simply slows down over time. With Macbooks, I just close the lid. It’s just like switching on/off a TV set. I have used many windows laptops and none of them ‘gets ready’ as fast as a Mac – as soon as you open the lid. With Windows, it simply won’t work.

For embedded developers (like me), a Mac is a good choice as it runs a Linux-like kernel. Also, for graphics designers a Mac is the best choice as the display is stunning. There is no comparison.

Being said all that, I still can’t imagine a Mac replacing Windows. Mac allows good Windows integration with Bootcamp (Yes, I use dual boot). I also have a windows VM running in background all the time.

Most of the general-purpose software is available in both platforms. Exceptions are Picasa Photo Viewer or irfan view or gTalk, which I use extensively in Windows. It’s very hard and sometimes impossible to find support for some software especially specialized (industrial) software/hardware in Mac. Another reason I can’t let go of Windows, is gaming. Mac is not an option for a true gamer.

If anyone has a misconception that Macs wont get stuck or there is no Ctrl-Alt-Del in Mac, now is a good time to leave them behind. Macs do get stuck in the middle of nothing, some times even for trivial things like muting. Also they are not significantly faster than Windows, as some may suggest. Its just that Macs always come with expensive and high performance hardware associated with them.

Even though Safari is their flagship browser with a cool look and feel, it's one of the worst browser I have used, till date. It simply won’t work with Gmail or even blogger. It also has compatibility problems. Firefox is not as evolved as in Windows and so most of the times I end up using Chrome in Mac.

The biggest problem of all is that Macs are super pricey. Not only a Mac, but any software or accessory that is associated with a Mac comes with a hefty price tag. A normal Mac is almost as costly as a top class Windows laptop (which makes Mac a rich man's toy, in my opinion).

I can’t conclude in a single statement whether Windows or Mac is better. I would like to put my conclusion in this way. If you are planning to purchase a computer/laptop,
1.    If you are in a budget, don’t even think about going for a Mac, you’ll probably end up bankrupt.
2.    If you have just enough money to buy a Mac, use it to buy a top class Windows machine.
3.    If you have surplus amount of money at your disposal (or your office is providing you the machine), buy a Mac and install Windows in it so that you can exploit the good of both worlds (which is what I am doing currently).

That’s it, I would never choose a 'Mac only world', but having a Mac with Windows is a powerful combination – something I would like having always.

Something’s, I will never get over with!

I felt it again, the same feelings which I felt around 7 years back, when I had to leave everything I knew in my life behind and had to step out in to the open world on my own – yes, I am talking about the time when I graduated. I saw the same sequence of events happening all over again, even though the environment and the people were totally different. It was as though history was repeating itself all over again.

Since I work in a university, I got the privilege of being part of a student club. Last weekend, it was their big annual event and as a club member, I also decided to do my part by helping them out. At first, I was a bit irritated due to the fact that I will loose a hard earned weekend and also I had to get up early (believe me, I cant remember the last time I did that). But it turned out to be way better than what I expected.

I got the opportunity of being in the middle of a bunch of highly motivated undergrad students who are organizing an event. Any one who had organized an event in their school/college days knows how it feels like. It’s too damn hectic and tiring at the time of the event. You have to run around fixing stuff, manage others, and no matter how good the planning is, things go haywire all the time.  But after the event, when you look back, you get the satisfaction of a great achievement. And you feel more bonded with your teammates.

All these totally reminded me of the events I had been part of organizing, during my undergrad days. Even though I didn’t do much this time, I got a feel of it. It was a kind of Déjà vu for me. The people who did marketing/publicity reminded me of those times when we went around looking for sponsors or travelled far and wide with the posters of the events. I could correlate almost anything I saw there to my college days, like the registration team or the participation in the events or rushing with a last minute change or people sleeping in the organizing area who were tired to death. I even witnessed people having crushes on others.

But the moment that inspired me to write this blog happened after the event. When it was only the club members, the juniors decided to give going away presents to the graduating students from the club. There was this very friendly girl among them who got totally surprised by this and as I expected, got emotionally overwhelmed. Tears started flowing from her eyes. The gift only made things worse. It was a collage with all those great moments with her friends. Gosh, that’s when I went back to the time when we all sang ‘Kabhi Alvida na Kehana (never say goodbye)’. I wanted to pass on to her something a very good friend of mine told me precisely at the time when I was feeling really depressed about leaving college. “Don’t be sad that it’s over, be happy that it has happened.” But then I thought it’s better to let her figure it out on her own. Besides, I am never good with words at moments like these.

I do wonder sometimes, why do we need “goodbyes” and “thank you”s? I feel it too formal. For me, the best thing to do is to just walk away. No “goodbyes”, no “see you”s; just like you are coming back the next day. We don’t say goodbye at the end of a typical day. People say “One must move on when its time to move on”. There are times when I think I have moved on from a lot of things. But moments like these prove me wrong, that no matter what, I won’t be able to get over with some things, that even now, I look back in time and long to relive those crazy & nostalgic moments of my life.

Popular Misconceptions about Japan

Recently I got the opportunity to travel to Japan. I had fancied a japan visit for a long time and so I had some background knowledge about Japan, by the time of my travel. Besides, I have some very good friends in japan through whom I had learned most of what I know now about japan. 

Before I went to Japan, I had lots of ideas about what I might find in Japan. Most of them were correct and some were not that correct. Overall, I would say, I was better off than many other people I had discussed about Japan. Sometimes, the level of misinformation people had about japan, amazed me. So I decided it’d be a good time to clarify some of them. I won’t be sharing much about my experiences in Japan, as it’s a subject for another blog(s).

The only language in Japan in Japanese and its very difficult to travel in Japan because of the language barrier
I was a bit worried before my travel about the language barrier, but it turned out to be just as easy as navigating through any other tourist location. Its true that the Japanese are not that well versed in English, but most of the sign boards have English instructions and most railway stations have tourist information centers nearby. In the worst case, I simply used sign languages as the Japanese go to great lengths to help you.

Geishas are prostitutes
Another blunder! Geisha is a female entertainer, not a prostitute. If anything, they were strictly forbidden to have paid sex. “In the late eighteenth century, dancing women called "odoriko" and newly popular female geisha began entertaining men at banquets in unlicensed districts. Some were apprehended for illegal prostitution and sent to the licensed quarters, where there was a strict distinction between geisha and prostitutes, and the former were forbidden to sell sex.” – from Wikipedia
There are pornographic videos, which claim to be featuring Hollywood actress. But that doesn’t make Hollywood actresses, prostitutes. Geisha’s case is also similar.
Original geishas exist even today, in the Gion area in Kyoto. And Japanese are very proud about geishas.

Japanese eat snakes, scorpions and stuff or the main Japanese dish is raw fish and they don’t eat other cuisines
Totally wrong! I don’t know who eats snakes, may be the Chinese or the Koreans, but not Japanese. They like seafood a lot and perhaps the most curious thing I found is a sea urchin sushi.
They do eat a lot of raw fish (sushi, sashimi etc.) and its very tasty if prepared by a licensed chef. But they do have other dishes like the ramen, udon, domburi etc. Another thing I noticed during my travel is, they love Italian food. I could find as many Italian restaurants as Japanese restaurants. Also I found Middle Eastern food, Indian food and even Kerala food in Japan.

They are extremely conventional or they are extremely advanced and so no traditional
They are a bit of both. They live in the edge of technology and at the same time they keep their traditional values. It’s amazing how they find the right balance between both. Very close to Akihabara – the electric town, Tokyo – you can find Asakusa with the famous Sensoji Temple where they still pray.  They wear Kimono’s (traditional dress) with the same pride as they wear their extremely formal official dress. They never leave their traditions behind for modern lifestyle. 

A couple of other misconceptions are, they are very cold-hearted people, anime & manga are cartoons, Yakuza is a myth etc.

As for me, two quotes from the movie The Last Samurai sums up my perception about Japan and its people,
Everyone is polite. Everyone smiles and bows. But beneath their courtesy, I detect a deep reservoir of feeling.
They are an intriguing people. From the moment they wake they devote themselves to the perfection of whatever they pursue. I have never seen such discipline.