[petsc-users] Did CUDA break again?

Barry Smith bsmith at petsc.dev
Wed May 26 18:13:24 CDT 2021


  What is HOST=cori09  Does it have GPUs?

  https://docs.nvidia.com/cuda/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_164490976c8e07e028a8f1ce1f5cd42d6 <https://docs.nvidia.com/cuda/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_164490976c8e07e028a8f1ce1f5cd42d6>

  Seems to clearly state

int  cudaDeviceProp <https://docs.nvidia.com/cuda/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp>::major <https://docs.nvidia.com/cuda/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_164490976c8e07e028a8f1ce1f5cd42d6> [inherited] 
Major compute capability 



Mark, please compile and run this program on the machine you are running configure on

#include <stdio.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime_api.h>
#include <cuda_device_runtime_api.h>
int main(int arg,char **args)
{
struct cudaDeviceProp dp;
                cudaGetDeviceProperties(&dp, 0);
                printf("%d\n",10*dp.major+dp.minor);

                int major,minor;
		cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, 0);
cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, 0);
                printf("%d\n",10*major+minor);
                return(0);
}

This is what I get 

$ nvcc mytest.c -lcuda
~/petsc (main=) arch-main
$ ./a.out
70
70

Which is exactly what it is suppose to do.

Barry

> On May 26, 2021, at 5:31 PM, Barry Smith <bsmith at petsc.dev> wrote:
> 
> 
>   Yes, this code which I guess never got hit before 
> 
> cudaDeviceProp dp;                cudaGetDeviceProperties(&dp, 0);                printf("%d\n",10*dp.major+dp.minor);                return(0);;
> 
> is using the wrong property for the generation. 
> 
>  Back to the CUDA documentation for the correct information. 
> 
> 
> 
>> On May 26, 2021, at 3:47 PM, Jacob Faibussowitsch <jacob.fai at gmail.com> wrote:
>> 
>> 1120 sounds suspiciously like some CUDA version rather than architecture or compute capability…
>> 
>> Best regards,
>> 
>> Jacob Faibussowitsch
>> (Jacob Fai - booss - oh - vitch)
>> Cell: +1 (312) 694-3391
>> 
>>> On May 26, 2021, at 22:29, Mark Adams <mfadams at lbl.gov> wrote:
>>> 
>>> I started to get this error today on Cori. 
>>> 
>>> nvcc fatal   : Unsupported gpu architecture 'compute_1120'
>>> 
>>> I am pretty sure I had a clean build but I can redo it if you don't know where this is from.
>>> 
>>> Thanks,
>>> Mark
>>> <configure.log>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210526/0201ef10/attachment.html>


More information about the petsc-users mailing list