Fix errors on AMD devices