Skip to content

CUDA Errors (LNK1181, Invalid Argument) & AttributeError When Running Inference on Windows #63

Description

@yeyiXY

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:

  1. 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

  2. Reproduction Command
    python -m scripts.inference_triposg --image-input assets/example_data/hjswed.png --output-path ./output.glb

  3. 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'

  1. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions