In Arthur Conan Doyle's original 60 stories: Holmes is described as a violinist (e.g., A Study in Scarlet, The Adventure of the Mazarin Stone), but he plays poorly when agitated and well when contemplative. It is a character trait, not a professional pursuit.
In the BBC series Sherlock (2010–2017): Benedict Cumberbatch's Holmes plays the violin frequently and skillfully—an iconic visual motif modernizing the canonical detail.
Conclusion: Holmes does play the violin in the books, but the "virtuoso detective" image is largely a pop-culture amplification from screen adaptations.