Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CUDA toolkit error on MAC: unable to open output file 'vectorAdd.o':, Permission denied

Tags:

macos

cuda

I am trying to run CUDA toolkit on MAC, but when I am compiling CUDA sample programs I get this error:

unable to open output file 'vectorAdd.o': 'Error opening output file 'vectorAdd.o': Permission denied'

I checked the environmental variables and the driver installation and everything seems OK.

Do you have some clue what could be the problem?

Thanks!

Momir

like image 272
Moki Avatar asked Dec 05 '22 22:12

Moki


1 Answers

If you copy the whole samples folder and its contents to your home directory, you should be able to compile the samples there without sudo.

The problem is that the directories which contain the sample files are owned by root and not writable by admin users, so the compiler cannot create the new output files and folders it needs if you are running as an admin user.

If you want to compile the samples in situ (as the installation guide seems to suggest), you can compile them using sudo. Alternatively you can change the ownership of the samples directory and its subdirectories recursively:

sudo chown -R your-user-name /Developer/NVIDIA/CUDA-7.0/samples
like image 56
Tom Avatar answered Apr 19 '23 23:04

Tom