Value 'sm_6.0' is not defined for option 'gpu-architecture'

I am using nvcc version 9.2

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:07:04_CDT_2018
Cuda compilation tools, release 9.2, V9.2.148

I have two nvcc installed to i set the path to the latest version i.e. nvcc 9.2.

echo $PATH
/usr/local/cuda-9.2/bin:/home/nomi/bin:/home/nomi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

The environment variable is pointing to the correct library path

echo $LD_LIBRARY_PATH
/usr/local/cuda-9.2/lib64

What could be the possible issue ?

sm_6.0 is not a valid choice/flag

The correct choice/flag is sm_60

not providing the actual compile command, nor the actual compiler error output, doesn’t make it easier to answer your question

also, the LD_LIBRARY_PATH environment variable has absolutely nothing to do with compilation

Here it is

nvcc -arch=sm_60 kernel.cu
nvcc fatal   : Value 'sm_60' is not defined for option 'gpu-architecture'

You state that you have two versions of CUDA installed, one of which is CUDA 9.2. What’s the other version?

Can you show (by cut & paste) what happens when you invoke the following from the bash command line:

which nvcc; nvcc -V; nvcc -arch=sm_60 kernel.cu

Other version is 7.5

The nvcc -v option showed me that the PATH is pointing to the previous version, i figured it out that i had changed the PATH for user and not for the root;while i was compiling as a root (a pure mistake)

root@user: nvcc -v -arch=sm_30 kernel.cu 
 
#$ _SPACE_= 
#$ _CUDART_=cudart
#$ _HERE_=/usr/lib/nvidia-cuda-toolkit/bin
#$ _THERE_=/usr/lib/nvidia-cuda-toolkit/bin
#$ _TARGET_SIZE_=
#$ _TARGET_DIR_=
#$ _TARGET_SIZE_=64
#$ NVVMIR_LIBRARY_DIR=/usr/lib/nvidia-cuda-toolkit/libdevice
#$ PATH=/usr/lib/nvidia-cuda-toolkit/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

Problem solved. thank you

This may not be related to this thread but I would like to know to safely and thoroughly delete the previous version without effecting the current version.

OS: Linux (ubuntu 16.04)

I figured the other version must be < 8.0 since it doesn’t recognize sm_80, and that you are picking up the old version.

I wouldn’t worry about removing an old CUDA version, simply set up your environment properly. I have three or four versions of CUDA installed on my machine and haven’t noticed any issues with disk usage.

FWIW, friends don’t let friends build as root. Conventional wisdom is that root should only be used to accomplish tasks that absolutely require root access. Everything amounts to playing with fire.

The kernel i use; uses mlock(…) which require root privileges for locking files > 64k, Instead of giving password time-to-time, i login as root and use my up+enter to build and run the kernel ;)

Anyways, i am not willing to remove the old version now.