shader-slang / slang-torch Goto Github PK
View Code? Open in Web Editor NEWA Python package for calling Slang modules from PyTorch.
License: MIT License
A Python package for calling Slang modules from PyTorch.
License: MIT License
Hello,
I am trying to run the example here:
and I get the following error message:
ImportError: /usr/local/home/[uname]/miniconda3/envs/slang_torch/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /usr/local/home/[uname]/work/example_slang/.slangtorch_cache/square/44136fa355b3678a/0/_slangtorch_square_44136fa355b3678a.so)
Here is my conda environment:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
bzip2 1.0.8 h5eee18b_6
ca-certificates 2024.3.11 h06a4308_0
expat 2.6.2 h6a678d5_0
filelock 3.14.0 pypi_0 pypi
fsspec 2024.5.0 pypi_0 pypi
hatchling 1.24.2 pypi_0 pypi
jinja2 3.1.4 pypi_0 pypi
ld_impl_linux-64 2.38 h1181459_1
libffi 3.4.4 h6a678d5_1
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libstdcxx-ng 11.2.0 h1234567_1
libuuid 1.41.5 h5eee18b_0
markupsafe 2.1.5 pypi_0 pypi
mpmath 1.3.0 pypi_0 pypi
ncurses 6.4 h6a678d5_0
networkx 3.3 pypi_0 pypi
ninja 1.11.1.1 pypi_0 pypi
numpy 1.26.4 pypi_0 pypi
nvidia-cublas-cu12 12.1.3.1 pypi_0 pypi
nvidia-cuda-cupti-cu12 12.1.105 pypi_0 pypi
nvidia-cuda-nvrtc-cu12 12.1.105 pypi_0 pypi
nvidia-cuda-runtime-cu12 12.1.105 pypi_0 pypi
nvidia-cudnn-cu12 8.9.2.26 pypi_0 pypi
nvidia-cufft-cu12 11.0.2.54 pypi_0 pypi
nvidia-curand-cu12 10.3.2.106 pypi_0 pypi
nvidia-cusolver-cu12 11.4.5.107 pypi_0 pypi
nvidia-cusparse-cu12 12.1.0.106 pypi_0 pypi
nvidia-nccl-cu12 2.20.5 pypi_0 pypi
nvidia-nvjitlink-cu12 12.4.127 pypi_0 pypi
nvidia-nvtx-cu12 12.1.105 pypi_0 pypi
openssl 3.0.13 h7f8727e_1
packaging 24.0 pypi_0 pypi
pathspec 0.12.1 pypi_0 pypi
pillow 10.3.0 pypi_0 pypi
pip 24.0 py312h06a4308_0
pluggy 1.5.0 pypi_0 pypi
python 3.12.3 h996f2a0_1
readline 8.2 h5eee18b_0
setuptools 69.5.1 py312h06a4308_0
slangtorch 1.2.0 pypi_0 pypi
sqlite 3.45.3 h5eee18b_0
sympy 1.12 pypi_0 pypi
tk 8.6.14 h39e8969_0
torch 2.3.0 pypi_0 pypi
torchaudio 2.3.0 pypi_0 pypi
torchvision 0.18.0 pypi_0 pypi
trove-classifiers 2024.5.17 pypi_0 pypi
typing-extensions 4.11.0 pypi_0 pypi
tzdata 2024a h04d1e81_0
wheel 0.43.0 py312h06a4308_0
xz 5.4.6 h5eee18b_1
zlib 1.2.13 h5eee18b_1
my gcc version
gcc (Debian 13.2.0-10) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
and my cuda-toolkit:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131
Build cuda_12.4.r12.4/compiler.34097967_0
Seems to me that the libstdc++.so.6 that comes with torchslang is doesn't have 3.4.32 but that is a bit wierd because if I do:
ldd --version
I get:
ldd (Debian GLIBC 2.37-18+gl0) 2.37
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Which is not 3.4.32
As I understand from the documents, this package only works with CUDA.
The question is, when can we expect other GPUs be supported such as Intel and AMD? (using slang's Vulkan backend for example).
Hello,
when I try to run the first example in https://shader-slang.com/slang/user-guide/a1-02-slangpy.html,
I get following message
C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\torch\utils\cpp_extension.py:1967: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
Traceback (most recent call last):
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 2107, in _run_ninja_build
subprocess.run(
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\WorkSpace\slangTest\111.py", line 4, in <module>
m = slangtorch.loadModule('square.slang')
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\slangtorch\slangtorch.py", line 616, in loadModule
rawModule = _loadModule(fileName, moduleName, buildDir, options, sourceDir=outputFolder, verbose=verbose, includePaths=includePaths, dryRun=False)
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\slangtorch\slangtorch.py", line 535, in _loadModule
slangLib, metadata = compileAndLoadModule(
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\slangtorch\slangtorch.py", line 426, in compileAndLoadModule
slangLib = _compileAndLoadModule(metadata, sources, moduleName, buildDir, slangSourceDir, verbose)
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\slangtorch\slangtorch.py", line 465, in _compileAndLoadModule
return jit_compile(
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\slangtorch\util\compile.py", line 71, in jit_compile
_write_ninja_file_and_build_library(
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 1832, in _write_ninja_file_and_build_library
_run_ninja_build(
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\site-packages\torch\utils\cpp_extension.py", line 2122, in _run_ninja_build
message += f": {error.output.decode(*SUBPROCESS_DECODE_ARGS)}" # type: ignore[union-attr]
File "C:\Users\Dell\.conda\envs\surfel_splatting\lib\encodings\oem.py", line 15, in decode
return oem_decode(input, errors, True)
UnicodeDecodeError: 'cp1' codec can't decode bytes in position 0--1: No mapping for the Unicode character exists in the target code page.
My torch
version is 2.3.0, cuda
version is 12.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.