-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: /root/.cache/torch_extensions/py310_cu124/nvdiffrast_plugin/nvdiffrast_plugin.so: cannot open shared object file: No such file or directory #207
Comments
You can find the nvdiffrast_plugin, and to use ninja compile file. |
cd C:\Users*\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu124\nvdiffrast_plugin |
thanks a lot for answer will try |
I have the same question. Are you fix the bug? |
hello i have same problem... |
Please translate this file into English. I hope the file can help you!
On Fri, Dec 27, 2024 at 3:53 AM devrosx ***@***.***> wrote:
hello i have same problem...
and ninja failed to compile....
`(env) ***@***.***:~/pinokio/cache/XDG_CACHE_HOME/torch_extensions/py310_cu121/nvdiffrast_plugin$
ninja
[1/6] /home/pc/pinokio/bin/miniconda/bin/nvcc
--generate-dependencies-with-compile
--dependency-o...ib/python3.10/site-packages/nvdiffrast/common/cudaraster/impl/RasterImpl.cu
-o RasterImpl.cuda.o
FAILED: RasterImpl.cuda.o
/home/pc/pinokio/bin/miniconda/bin/nvcc
--generate-dependencies-with-compile --dependency-output
RasterImpl.cuda.o.d -DTORCH_EXTENSION_NAME=nvdiffrast_plugin
-DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc"
-DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem
/home/pc/pinokio/api/comfy.git/app/env/lib/python3.10/site-packages/torch/include
-isystem
/home/pc/pinokio/api/comfy.git/app/env/lib/python3.10/site-packages/torch/include/torch/csrc/api/include
-isystem
/home/pc/pinokio/api/comfy.git/app/env/lib/python3.10/site-packages/torch/include/TH
-isystem
/home/pc/pinokio/api/comfy.git/app/env/lib/python3.10/site-packages/torch/include/THC
-isystem /home/pc/pinokio/bin/miniconda/include -isystem
/home/pc/pinokio/bin/miniconda/include/python3.10
-D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS_ -D__CUDA_NO_BFLOAT16_CONVERSIONS__
-D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr
-gencode=arch=compute_86,code=compute_86
-gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -DNVDR_TORCH
-lineinfo -std=c++17 -c
/home/pc/pinokio/api/comfy.git/app/env/lib/python3.10/site-packages/nvdiffrast/common/cudaraster/impl/RasterImpl.cu
-o RasterImpl.cuda.o
In file included from
/home/pc/pinokio/bin/miniconda/include/cuda_runtime.h:83,
from :
/home/pc/pinokio/bin/miniconda/include/crt/host_config.h:132:2: error:
#error -- unsupported GNU version! gcc versions later than 12 are not
supported! The nvcc flag '-allow-unsupported-compiler' can be used to
override this version check; however, using an unsupported host compiler
may cause compilation failure or incorrect run time execution. Use at your
own risk.
132 | #error -- unsupported GNU version! gcc versions later than 12 are
not supported! The nvcc flag '-allow-unsupported-compiler' can be used to
override this version check; however, using an unsupported host compiler
may cause compilation failure or incorrect run time execution. Use at your
own risk.
``
—
Reply to this email directly, view it on GitHub
<#207 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJN2XRD6KMUOY4OX5E3I3I32HRNEPAVCNFSM6AAAAABRGHH6ZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRTGA3DAOJUGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
ImportError: /home/data2/chuan/.conda/envs/DiffTex_New/lib/python3.10/site-packages/torch/lib/../../../.././
libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/data2/chuan/.cache/torch_extensions/py310_cu118/nvdiffrast_plugin/nvdiffrast_plugin.so)
这个错误使用以下命令
rm /home/data2/chuan/.conda/envs/DiffTex_New/lib/libstdc++.so.6
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29 /home/data2/chuan/.conda/envs/DiffTex_New/lib
ln -s /home/data2/chuan/.conda/envs/DiffTex_New/lib/libstdc++.so.6.0.29 /home/data2/chuan/.conda/envs/DiffTex_New/lib/libstdc++.so.6
nvcc fatal : Value ‘c++17’ is not defined for option ‘std’
因为是第一次用这个机器,用户的环境变量里没有加新版本的cuda,于是在~/.bashrc里加入下面两行:
export PATH="/usr/local/cuda-11.3/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.3/lib64:$LD_LIBRARY_PATH"
我解决了这个问题:
1、首先,cl.exe ninja 的路径要对,要能找的到
2、你的 anaconda3\envs\instantmesh\Lib\site-packages\torch\utils\cpp_extension.py 中,将2065行改成 command = ['ninja', '--version'], 以解决ninja -v的错误
3、你的 anaconda3\envs\instantmesh\Lib\site-packages\nvdiffrast\torch\ops.py中,将118行改成 verbose=True
4、运行python app.py,大概聊仍然会报找不到nvdiffrast_plugin,这时候到
C:\Users****\AppData\Local\torch_extensions\Cache\py310_cu121\nvdiffrast_plugin
或者/home/data2/chuan/.cache/torch_extensions/py310_cu121/nvdiffrast_plugin
目录下,手动运行ninja,以生成nvdiffrast_plugin
注意,我这里还有一个问题,就是安装cuda12.1.0后,在系统环境变量中,没有自动生成CUDA_PATH环境变量,需要手动指向cuda12.1.0的目录。这也是为什么在ninja时,nvcc使用的是conda的nvcc,导致ninja编译失败!
rmdir /S %userprofile%\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu121\nvdiffrast_plugin
set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\
computer89错误本质上是因为CUDA版本低所以不支持89的计算
把CUDA版本的环境变量换成高版本的CUDA路径即可
原因是conda环境下cuda编译器nvcc不支持compute_89导致安装失败,
运行项目的requirement.txt安装环境往往会默认安装低版本的cuda环境。
通过 nvcc --list-gpu-arch 来查看支持的编译器
如果没有compute_89(nvcc --version版本是11.5或者以下),
可以修改.bashrc
export PATH=/usr/local/cuda-12.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH
更新环境变量
source ~/.bashrc
再次查看nvcc --list-gpu-arch是否有compute_89
如果没有的话,可以用which nvcc查看nvcc目录
which nvcc
如果nvcc目录不是/usr/local/cuda-12.1 ,需要重新配置,先备份下原环境,然后重新配置
sudo mv /usr/bin/nvcc /usr/bin/nvcc.bak
sudo ln -s /usr/local/cuda-12.1/bin/nvcc /usr/bin/nvcc
这样就可以了。
如果没有更高版本的cuda和nvcc就需要重新安装cuda和nvcc
|
Thanks found way to fix it allready |
Main issue : Tencent/Hunyuan3D-1#5
How I installed with no errors on Cuda 12.4, Python 3.10.11 :
pip install git+https://github.com/NVlabs/nvdiffrast
RTX A6000 , ubuntu 22
The text was updated successfully, but these errors were encountered: