Japanese technology giant SoftBank says it has sold its stake in Nvidia, raising $5.8 billion to pour into other investments.