South Africa were 299 for one at the end of a day shortened by rain and bad light. South African captain Smith was unbeaten on 138 and Amla had 103.
Smith and Neil McKenzie (42) set up South Africa's dominant performance with an opening partnership of 102.
McKenzie admitted that batting conditions were tricky early in the day, with Bangladesh new ball bowlers Mashrafe Mortaza and Mahubul Alam testing the batsmen with swing and movement off a pitch which had some green patches.
"We weren't surprised when they decided to send us in but we would have batted first if we had won the toss," said McKenzie. "It wasn't a pitch to drive on and they probably bowled a bit too short early on."
When conditions eased the batsmen took almost total control. Smith and Amla lifted the tempo with an unbroken second wicket stand of 197 before bad light finally ended play one over after the second new ball was taken.
Both centurions survived chances. When Smith was on 83 he went down the wicket to left-arm spinner Shakib al Hasan.
The ball spun past the inside of his bat but also went past wicketkeeper Mushfiqur Rahim who could not make the stumping. He gave a sharp chance to Imrul Kayes at short leg off Mehrab Hossain, another left-arm spinner, when he had 118.
Amla was on 93 when he edged Mehrab Hossain to Mashrafe Mortaza at slip.
"I was quite happy with our bowling, although we could possibly have bowled at the stumps a bit more," said Bangladesh captain Mohammad Ashraful. "If we had held our chances it would have been better but they batted very well."
Smith became South Africa's leading run-scorer in a calendar year when he went past the 1288 scored by Jacques Kallis in 2004. Smith had scored 1317 runs in the year by close of play.
In only his second innings since recovering from a tennis elbow injury, Smith went to his 17th Test century - his third against Bangladesh - off 177 balls, hitting 13 fours.
Amla needed 149 balls for his sixth Test century, hitting 10 fours.
It was the tenth successive Test in which Smith and McKenzie posted at least one 50-run opening partnership. The previous record of eight was held by Roy Fredericks and Gordon Greenidge of the West Indies.
Ashraful said his decision to send South Africa in was influenced by the amount of grass on the pitch which could help the bowlers during the first two hours.
The pitch indeed proved lively early on but his bowlers could not make a breakthrough until McKenzie sliced a drive off Shahadat Hossain to backward point midway through the afternoon.McKenzie played a typically cautious innings, facing 118 balls and hitting seven fours as he provided watchful support to Smith. When McKenzie was on 12 he became the tenth South African to score 3000 Test runs.
Bangladesh handed a first Test cap to opening batsman Imrul Kayes, 21, while Mortaza was declared fit after struggling with a back injury.