Coder Social home page Coder Social logo

Can't compile with nvcc about filesystem HOT 4 OPEN

yanggthomas avatar yanggthomas commented on July 18, 2024
Can't compile with nvcc

from filesystem.

Comments (4)

yanggthomas avatar yanggthomas commented on July 18, 2024 1

截屏2022-01-13 下午10 32 59

截屏2022-01-13 下午10 33 57

hope these could help you

from filesystem.

gulrak avatar gulrak commented on July 18, 2024 1

Sorry, it took more time than expected to look into this. I had a test installing nvidia-cuda-toolkit on my 20.04 Ubuntu, that gives me:

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

So sadly not exactly the same conditions.

I then made a build folder and from there simply tried:

$  nvcc ../test/filesystem_test.cpp -I ../include/

It ran without any error and the resulting a.out of that test gave me:

$ ./a.out 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.out is a Catch v2.13.7 host application.
Run with -? for options
[... cut expected warning output for things that can vary on platforms ...]
===============================================================================
All tests passed (1081 assertions in 70 test cases)

So my OS is newer but the CUDA toolkit is older, but I have the feeling something else is leading to those errors and I would need some reproducible example with the compile parameters.

I'm by no means a CUDA expert and don't use it in any project, so any help is welcome.

from filesystem.

gulrak avatar gulrak commented on July 18, 2024

Thanks for reporting this, not sure why this is happening. I don't have access to a system with nvcc yet, maybe I can set up one in a VM, but I need more informations like the version of nvcc and the OS to at least try to replicate it.

from filesystem.

yanggthomas avatar yanggthomas commented on July 18, 2024

Sorry for the late reply.

It could be because nvcc is actually passing the pure cpp/c source file to g++/gcc on linux. As you can see in https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#supported-host-compilers, which says "During non-CUDA phases (except the run phase), because these phases will be forwarded by nvcc to this compiler.". Here the host compiler means gcc on Linux.

As for this particular case, the error occurs if I put some code of filesystem in *.cu file, which will be processed by nvcc first. However, basiclly filesystem is not required on device(GPU) since generally this is not the part we want to accelerate via GPU and CUDA. Actually, this is a supported feature of nvcc that host only code in *.cu will be forward to host compiler.

So personally speaking, I tend to regard this problem as a bug of nvcc. Probably add a hint in the documentation to suggest others to use "forward/implementation" style with CUDA, in this way, the filesystem code will be processed only by host compiler and nvcc will stop complaining.

Additionally, to reproduce the error, maybe I can write some small examples. But I am relative new to github and I am not sure how to pass the code properly.

from filesystem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.