I have Ubuntu 18.04 and NVIDIA Driver version 435.21, compatible with CUDA toolkits 10.1 and below. I mainly use fortran in my applications and wanted the nvfortran compiler to accelerate my code. I have downloaded the NVIDIA HPC SDK 20.7 , loaded into the /opt directory, as per default. I have also downloaded CUDA 10.1 toolkit, installed in the /usr/local/cuda-10.1 directory.
I followed the post-installation instructions in the CUDA toolkit documentation and compiled the CUDA samples using the make file. All samples were compiled and a
bandwidthtest executable were created. Upon running those two executables, I got outputs, both with result PASS.
I then decided to run a helloworld code that simply prints HI across all cores of the GPU. I wrote it in C and fortran, attached as hellocuda_c.txt (227 Bytes) and hellocuda_fortran.txt (243 Bytes), respectively).
I compiled the C code using
nvcc, and it prints “HI” successfully n times, n being whatever number of compute units I set it to. The fortran code, however, did not successfully build. I ran it using
nvfortran -v -Minfo=all hellocuda.cuf and I have attached the logfile of the output in log_fortran.txt (3.6 KB) . A shorter version of the error thrown is :
NVFORTRAN-S-0155-Invalid value after compiler -cudacap flag 30 NVFORTRAN-S-1001-All selected compute capabilities were disabled (see -Minfo) (hellocuda.cuf: 1) 0 inform, 0 warnings, 1 severes, 0 fatal for
Every flag in the second para of log_fortran.txt output has something written after it, except for the -cudacap flag. I dont know what cudacap stands for - is it cuda compute capability? I thought it was this, and based on the deviceQuery output, the cc is 3.0 on my device. On the compute capability section 6.8 of the hpc sdk documentation, the compilers can generate code for GPUs with compute capability of 3.0-8.0, the default is set as 3.5-7.0 and I had to change this to 3.0. I thus did
nvfortran -gpu=cc30 to override the default compute capability, and got the message -
nvfortran-Error-The -gpu=cc30 option is no longer supported
I tried other commands with cc55, cc45, etc, but nothing ran. How do I change the compute capability? Is this even the issue? If it is, then how come it worked for the C code? If not then what might be the issue? I tried with the basic fortran example given in the Cuda fortran programming guide and got the same error.