I encountered a series of errors while executing the TripoSG inference script on Windows to generate a 3D mesh from an image. The process fails with CUDA-related link errors, runtime invalid arguments, and a final AttributeError due to NoneType mesh output. Below is a detailed breakdown of the error logs and reproduction steps:
-
Environment
OS: Windows 10
Python Version: 3.11
PyTorch Version: 2.6.0+cu124 (with CUDA support verified via torch.cuda.is_available() == True)
CUDA Version: 12.4 and 12.8
TripoSG Commit: latest main branch
-
Reproduction Command
python -m scripts.inference_triposg --image-input assets/example_data/hjswed.png --output-path ./output.glb
-
Error Log Snippets (Key Issues)
3.1 LINK Error (LNK1181) – Missing CUDA Libraries
test.c
LINK : fatal error LNK1181: 无法打开输入文件“aio.lib”
test.c
LINK : fatal error LNK1181: 无法打开输入文件“cufile.lib”
3.2 CUDA Runtime Error (Invalid Argument) – Host Memory Mismatch
final grids shape = torch.Size([505, 505, 505])
CUDA error 1: invalid argument (C:\Users\19316\AppData\Local\Temp\pip-install-9uicrm8v\diso_5de94e1cf59d459f8a0a1a7ddff74bf5\src\cudualmc.cu:1087)
CUDA error 1: invalid argument (C:\Users\19316\AppData\Local\Temp\pip-install-9uicrm8v\diso_5de94e1cf59d459f8a0a1a7ddff74bf5\src\cudualmc.cu:1088)
The specified pointer resides on host memory and is not registered with any CUDA device.
3.3 Final AttributeError – NoneType Mesh Output
Traceback (most recent call last):
File "F:\Local_AI\TripoSG\scripts\inference_triposg.py", line 95, in
run_triposg(...)
File "F:\Local_AI\TripoSG\triposg\pipelines\pipeline_triposg.py", line 315, in call
meshes = [trimesh.Trimesh(mesh_v_f[0].astype(np.float32), mesh_v_f[1]) for mesh_v_f in output]
File "F:\Local_AI\TripoSG\triposg\pipelines\pipeline_triposg.py", line 315, in
meshes = [trimesh.Trimesh(mesh_v_f[0].astype(np.float32), mesh_v_f[1]) for mesh_v_f in output]
AttributeError: 'NoneType' object has no attribute 'astype'
- Request
Could you help diagnose:
How to fix the "host memory not registered with CUDA device" error (ensuring tensor device consistency)?
How to prevent the NoneType mesh output that triggers the final AttributeError?
Let me know if additional environment details or logs are needed!
I encountered a series of errors while executing the TripoSG inference script on Windows to generate a 3D mesh from an image. The process fails with CUDA-related link errors, runtime invalid arguments, and a final AttributeError due to NoneType mesh output. Below is a detailed breakdown of the error logs and reproduction steps:
Environment
OS: Windows 10
Python Version: 3.11
PyTorch Version: 2.6.0+cu124 (with CUDA support verified via torch.cuda.is_available() == True)
CUDA Version: 12.4 and 12.8
TripoSG Commit: latest main branch
Reproduction Command
python -m scripts.inference_triposg --image-input assets/example_data/hjswed.png --output-path ./output.glb
Error Log Snippets (Key Issues)
3.1 LINK Error (LNK1181) – Missing CUDA Libraries
test.c
LINK : fatal error LNK1181: 无法打开输入文件“aio.lib”
test.c
LINK : fatal error LNK1181: 无法打开输入文件“cufile.lib”
3.2 CUDA Runtime Error (Invalid Argument) – Host Memory Mismatch
final grids shape = torch.Size([505, 505, 505])
CUDA error 1: invalid argument (C:\Users\19316\AppData\Local\Temp\pip-install-9uicrm8v\diso_5de94e1cf59d459f8a0a1a7ddff74bf5\src\cudualmc.cu:1087)
CUDA error 1: invalid argument (C:\Users\19316\AppData\Local\Temp\pip-install-9uicrm8v\diso_5de94e1cf59d459f8a0a1a7ddff74bf5\src\cudualmc.cu:1088)
The specified pointer resides on host memory and is not registered with any CUDA device.
3.3 Final AttributeError – NoneType Mesh Output
Traceback (most recent call last):
File "F:\Local_AI\TripoSG\scripts\inference_triposg.py", line 95, in
run_triposg(...)
File "F:\Local_AI\TripoSG\triposg\pipelines\pipeline_triposg.py", line 315, in call
meshes = [trimesh.Trimesh(mesh_v_f[0].astype(np.float32), mesh_v_f[1]) for mesh_v_f in output]
File "F:\Local_AI\TripoSG\triposg\pipelines\pipeline_triposg.py", line 315, in
meshes = [trimesh.Trimesh(mesh_v_f[0].astype(np.float32), mesh_v_f[1]) for mesh_v_f in output]
AttributeError: 'NoneType' object has no attribute 'astype'
Could you help diagnose:
How to fix the "host memory not registered with CUDA device" error (ensuring tensor device consistency)?
How to prevent the NoneType mesh output that triggers the final AttributeError?
Let me know if additional environment details or logs are needed!