Hello,
I possess a Jetson AGX Orin 64GB Dev-kit. I’m trying to install Quantum Espresso on it, although it is not the problematic point here.
Currently I’m facing problem with nvfortran and cuda, since I’m not able to compile an example fortran code with GPU support.
The setup is as follows:
- Machine set up via Nvidia SDKManager, installing JetPack6.2 (with cuda support);
- CUDA12.6 correctly installed;
- hpc_sdk 25.1 installed following this guide.
I’m failing to compile the following toy example:
program test_gpu_single_copy2
use cudafor
use iso_c_binding, only: c_loc, c_size_t, c_ptr
implicit none
integer, parameter :: n = 10
real(4), device :: d_array(n)
real(4), allocatable :: h_array(:)
integer :: i, ierr
integer(c_size_t) :: bytes
type(c_ptr) :: h_ptr, d_ptr
allocate(h_array(n))
bytes = n * 4_c_size_t ! 4 bytes per single-precision element
! Launch the kernel with one block of n threads
call kernel_set_value<<<1, n>>>( d_array )
ierr = cudaDeviceSynchronize()
if (ierr /= 0) then
print*, "cudaDeviceSynchronize error:", ierr
stop
end if
! Obtain C pointers explicitly from the Fortran arrays
h_ptr = c_loc(h_array(1))
d_ptr = c_loc(d_array(1))
! Call cudaMemcpy using the C pointers
ierr = cudaMemcpy(h_ptr, d_ptr, bytes, cudaMemcpyDeviceToHost)
if (ierr /= 0) then
print*, "cudaMemcpy error:", ierr
stop
end if
do i = 1, n
When I try to execute it with nvfortran -g -cuda -gpu=sm_87,cuda12.6 test_gpu.f90 -o test_gpu
it fails returning:
NVFORTRAN-S-0155-Could not resolve generic procedure cudamemcpy (test_gpu.f90: 28)
0 inform, 0 warnings, 1 severes, 0 fatal for test_gpu
Any hint about what could be wrong? Thank you.