Open randallrvr opened 5 months ago
Yeah I'm able to install using "pip install slangtorch" but the unit tests fail. It would be nice to get more clarification. I am using CUDA 11.8, and PyTorch 2.4. I get the following error: fatal error C1083: Cannot open include file: 'slang.h': No such file or directory ninja: build stopped: subcommand failed.
https://github.com/shader-slang/slang-torch/issues/24 I guess is a duplicate!
@randallrvr Did you figure out any workaround for how to install in an environment (or any hack to make it work)?
Ok I had some success, looking around I couldn't find any slang.h on my system, so I figured maybe it also needs a base slang install - which is the case.
I did two things:
${CONDA_PREFIX}
CPLUS_INCLUDE_PATH=${CONDA_PREFIX}/include
(can put this in $CONDA_PREFIX/etc/conda/activate.d/activate_slang.sh
to happen on environment activate)compilers
meta-package)Presumably, this also works if you install it in your system the same way, but I'd rather not unpack tar files in my system folders outside the package manager.
@oliver-batchelor I took the slang.h from https://github.com/shader-slang/slang/blob/master/include/slang.h and copied it to my CUDA include path and it resolved the problem.
@4ri4Slr Thanks.
I guess question is where is slang.h
meant to come from, is slangtorch meant to be standalone? Maybe @saipraveenb25 saipraveenb25 can answer this?
The slang.h
problem stems from an issue with the main slang code-base. The main code-base has an embedding tool that 'inlines' all slang-related header files into a single string and embeds that into the slang binary.
Normally, there should not be any slang-related #include directives in the generated code. However, the embedding tool broke and failed to inline everything. Since we're still in the process of setting up proper CI between slangtorch & slang, this caused the v1.3.1 release to break. We fixed this here: https://github.com/shader-slang/slang/pull/5680
Could you try again with the new slangtorch release v1.3.2
which includes this fix?
There desperately needs to be some documentation on setting up a working slangtorch environment with CUDA and pytorch that is a bit more detailed than "pip install slangtorch"