UBI is not a solution to the 'problems of automation', because those problems don't exist outside of people with narrow vision and ignorance of history.
Automation has been around for a long time, dating back to the first human who figured out that cultivating crops could produce more food than their family could consume, giving them a surplus they could sell. They had to invent money to deal with the problems of selling the surplus in a barter economy... what a problem to have.
And people have been saying that automation will put everyone out of work for a long time. Ned Ludd wasn't the first to think that, he's just the one who was derisively immortalized for saying it.
Henry Ford came up with an automated method of putting cars together, where previously, cars had hand assembled one at a time. Required a lot less people, with a lot less training, to build a car, and that resulted in a car that was 1/5 the cost of the average car in 1910. Did that put people out of work? No, the cheaper automobile with it's fast on demand transportation, actually made a lot of new jobs possible. Gas stations to fuel the cars, steel to construct the cars, service centers to fix the cars, and jobs doing things that weren't economically feasable without cheap fast transportation, like traveling salesperson, delivery person, etc...
Continuing with the auto theme, the affordable all electric car will be reality within the next decade, possibly the next five years, eventually threatening to put oil production, refineries, gas stations and auto service centers out of business and costing jobs. New jobs will appear... making the things that people will be buying with all the money they save by not having to buy gasoline, and sending all that money to Arab oil barons or Russian oligarchs.
e-commerce threatens to put brick and mortar shops out of business. It creates delivery jobs, website developer jobs, and inventory management jobs, too.
I could go on like this all day. Humanity has been going on like this for centuries.
So, to restate the answer the question - UBI is not a solution to automation, because no solution has ever been needed to automation in the past, and will never be needed. For every job eliminated, a new one doing something that wasn't possible or economically feasable in the past, is created.
I'm surprised that someone with the vision of Musk can't see that.