Closed kfiros1 closed 2 years ago
Hey, Kfir,
bin2c is a tool that comes with CUDA; it takes a binary binary file (in our case, the PTX output from compiling the device code), and creates as output a c file that contains a string whose value is the same as that binary file. We use this to "fuse" the compiled PTX code into the binary by compiliing and linking to that C file (then we can use that PTX string as symbol, without having to deal with paths to fine and read that file).
The reason that ex01 still works without bin2c is that the first sample doesn't actually use any device code, yet; so that is OK. Ex02 and ongoing however will need it, because these do have device code.
As said bin2c comes with CUDA; if you have a cuda install (and have cuda in your path), then bin2c should also be in that path; it shold be in the same locatoin as nvcc. So; what I assume is that you have some "funky" cuda install where for some reason nvcc can be found, but bin2c cannot. The only thing that confuses me is that you're saying it works in release mode, but not in debug!? That doesn't make sense - either cmake can find bin2c, or it can't - it's the same tool, and in the cmake scripts gets used in the same way.
One simply thing I'd try first though is removing the CMakeCache.txt, and running the cmake call again, without -j (just in case). And of course, check if bin2c is in the path. (The upper-case BIN2C_NOTFOUND is cmake's way of telling you that the variable 'BIN2C" (which shold point to that binary) couldn't be computed, i.e., that bin2c couldn't be found).
Hi,
Thanks for the answer. I agree, this is very strange that Release can find it and Debug not, but that's what's happening! I'm not sure why this happens but you gave me the idea to check CMakeCache.txt for both.
I saw that in CMakeCache.txt in the release: BIN2C:FILEPATH=/usr/local/cuda/bin/bin2c
In debug it was NOTFOUND, so I set it manually in configure_optix.cmake: set(BIN2C /usr/local/cuda/bin/bin2c)
instead of: find_program(BIN2C bin2c DOC "Path to the cuda-sdk bin2c executable.")
Now it works for both.
Thanks a lot, Kfir
I had the exact same problem, but for my case both BUILD
and RELEASE
gave BIN2C NOT FOUND. I followed @kfiros1 first option, manually edit the CMakeCache.txt. Its working, thanks a lot @kfiros1 .
Hi,
Thanks for this great project.
I succeed build and run the whole project in release mode, however, when I try to debug it, I cant build it successfully. I've tried to debug it using CLion IDE from remote host (by deployment).
The problem occurs from ex02 onwards (ex01 is just loading the Optix and it works correctly for both release and debug).
For ex02: in Release mode, it builds it and runs successfully:
in Debug mode, it doesnt recognize BIN2C-NOTFOUND:
I guess the problem is: /bin/sh: 1: BIN2C-NOTFOUND: not found
In the CMAKE, it seems that this line is the problematic: find_program(BIN2C bin2c DOC "Path to the cuda-sdk bin2c executable.")
Do I need to locate some library? is this something about the cuda library? So why in release it works and debug mode does not? What do I miss?
Notes:
/usr/local/bin/cmake --build /home/kfir/code/optix7course/cmake-build-debug --target ex02_pipelineAndRayGen -- -j 6
so I guess the problem is not specifically for CLion deployment.Thanks, Kfir