Migrating to SYCL
One-stop forum for getting assistance migrating your existing code to SYCL
45 Discussions

vector_add - migration Cuda to DPCT does not work

HenryMoncada
Beginner
2,471 Views

Hello I am trying to understand migration using one of the examples vector-add-dpct/

1. I use intercept-build make to get  compile_commands.json

login-2:vector-add-dpct$ intercept-build make
nvcc src/vector_add.cu -o vector_add

2. I try to migrate using dpct

login-2:vector-add-dpct$ dpct -p compile_commands.json --in-root=. --out-root=migrated_code
dpct exited with code: -32 (Error: Intel(R) DPC++ Compatibility Tool was not able to detect path for CUDA header files. Use --cuda-include-path to specify the correct path to the header files.)

3. To fix the issue above I need to locate cuda  

login-2:vector-add-dpct$ locate cuda
/usr/include/hwloc/cuda.h
/usr/include/hwloc/cudart.h
/usr/include/linux/cuda.h
/usr/include/unicode/icudataver.h
/usr/include/x86_64-linux-gnu/libavutil/hwcontext_cuda.h
/usr/lib/x86_64-linux-gnu/libicudata.a
/usr/lib/x86_64-linux-gnu/libicudata.so
/usr/lib/x86_64-linux-gnu/libicudata.so.60
/usr/lib/x86_64-linux-gnu/libicudata.so.60.2
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpiext/cuda
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpiext/cuda/c
/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpiext/cuda/c/mpiext_cuda_c.h
/usr/share/nmap/scripts/http-barracuda-dir-traversal.nse
/usr/share/vim/vim80/indent/cuda.vim
/usr/share/vim/vim80/syntax/cuda.vim
/usr/src/linux-headers-4.15.0-76/include/linux/cuda.h
/usr/src/linux-headers-4.15.0-76/include/uapi/linux/cuda.h

4. Neither of the cuda paths about work and they are not similar to /usr/local/cuda/include 

login-2:vector-add-dpct$ dpct -p compile_commands.json --in-root=. --out-root=migration --cuda-include-path=/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpiext/cuda
dpct exited with code: -5 (Error: Path for CUDA header files specified by --cuda-include-path is invalid.)

5. Could someone let me know how they make this example work?

Best

 

0 Kudos
5 Replies
ShwethaS_Intel
Moderator
2,436 Views

Hi @HenryMoncada ,

 

Thanks for reaching out to us.

 

Please check the CUDA toolkit version installed, as per the latest Intel DPC++ Compatibility Tool System requirements, the only supported CUDA versions are: 8.0, 9.x, 10.1, 10.2, 11.0~11.6

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-dpc-compatibility-tool-system-requirements.html

 

If the requirements are not met, DPC++ Compatibility Tool will throw an error while migration. DPCT only needs CUDA headers from the supported versions. You can install CUDA toolkit in your home directory. You may find the instructions on the Nvidia official webpage.

Once you have installed the toolkit, include --cuda-include-path flag to perform migration.

dpct -p compile_command.json --cuda-include-path=<path/to/cuda/include>

 

Let me know if this helps.

 

Regards,

Shwetha

 

0 Kudos
HenryMoncada
Beginner
2,403 Views

I got  a few errors on CUDA INSTALLATION,   It asked me to install a new package called "BISON". I called the module,

login-2:cuda_11_0$ module load bison
I am still getting ERRORS. Maybe I am not doing cuda install correctly. Maybe you can help to figure out what i am doing wrong

1. Create a folder  call /usr/local
3. Extract: cuda_gdb_src-all-all-11.0.194.tar.gz  and change the name to cuda_11_0/
4. Run configure with NO problems
./configure --program-prefix=cuda- \
        --enable-cuda \
        --enable-targets="x86_64-apple-darwin,x86_64-unknown-linux-gnu,\
        arm-elf-linux-gnu,m68k-unknown-linux-gnu" \
        CFLAGS='-I/usr/local/cuda/include' \
        LDFLAGS='-lpthread'
5. Run  make,   I get the following errors
ada-lex.c missing and flex not available.
Makefile:2631: recipe for target 'ada-lex.c' failed
make[2]: *** [ada-lex.c] Error 1
make[2]: Leaving directory '/home/u136102/usr/local/cuda_11_0/gdb'
Makefile:9145: recipe for target 'all-gdb' failed
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory '/home/u136102/usr/local/cuda_11_0'
Makefile:850: recipe for target 'all' failed
make: *** [all] Error 2
6. Look online for 'ada-lex.c'  download into cuda_11_0/gdb/
7. Run  make,   I get the following errors
/home/u136102/usr/local/cuda_11_0/missing bison -y -d -p cuda_parser_ -b cuda-parser cuda-parser.exp.y
/home/u136102/usr/local/cuda_11_0/missing: 81: /home/u136102/usr/local/cuda_11_0/missing: bison: not found
WARNING: 'bison' is missing on your system.
         You should only need it if you modified a '.y' file.
         You may want to install the GNU Bison package:
         <http://www.gnu.org/software/bison/>
Makefile:2599: recipe for target 'cuda-parser.tab.c' failed
make[2]: *** [cuda-parser.tab.c] Error 127
make[2]: Leaving directory '/home/u136102/usr/local/cuda_11_0/gdb'
Makefile:9145: recipe for target 'all-gdb' failed
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory '/home/u136102/usr/local/cuda_11_0'
Makefile:850: recipe for target 'all' failed
make: *** [all] Error 2
login-2:cuda_11_0$ module list
Currently Loaded Modulefiles:
 1) bison/3.7(default) 
9. Run  make,   I get the following errors
/home/u136102/usr/local/cuda_11_0/missing bison -y -d -p cuda_parser_ -b cuda-parser cuda-parser.exp.y
cuda-parser.exp.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]
cuda-parser.exp.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
bison: /home/u84741/glob/apps/bison/3.7/share/bison/m4sugar/m4sugar.m4: cannot open: Permission denied
Makefile:2599: recipe for target 'cuda-parser.tab.c' failed
make[2]: *** [cuda-parser.tab.c] Error 1
make[2]: Leaving directory '/home/u136102/usr/local/cuda_11_0/gdb'
Makefile:9145: recipe for target 'all-gdb' failed
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory '/home/u136102/usr/local/cuda_11_0'
Makefile:850: recipe for target 'all' failed
make: *** [all] Error 2
 
0 Kudos
ShwethaS_Intel
Moderator
2,390 Views

Hi @HenryMoncada ,

 

If you want to download any older version of the CUDA toolkit, download it from this link, https://developer.nvidia.com/cuda-toolkit-archive

 

If you want to download the latest CUDA toolkit version follow, https://developer.nvidia.com/cuda-downloads

For Installer type select runfile(local) as option as shown below. And then follow the installation instructions given below in the web page.

Annotation 2022-07-15 105817.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



For further more information refer https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

 

Regards,

Shwetha

 

 

0 Kudos
ShwethaS_Intel
Moderator
2,371 Views

Hi @HenryMoncada ,

 

A gentle remainder to respond.

 

Regards,

Shwetha

 

0 Kudos
ShwethaS_Intel
Moderator
2,338 Views

Hi,


I assume that your issue is resolved. If you need any further assistance, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Shwetha



0 Kudos
Reply