Skip to content
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

User allocator error allocating 86114304000-byte buffer failure of TensorRT 10.6 when running demo_img2vid. py on GPU rtx4090 #4254

Open
kolyh opened this issue Nov 19, 2024 · 8 comments
Labels
Module:DemoDiffusion Issues regarding demoDiffusion triaged Issue has been triaged by maintainers

Comments

@kolyh
Copy link

kolyh commented Nov 19, 2024

Description

I tried to convert onnx to an engine file using demo_img2vid. py on rtx4090,but received the following error message:

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 86114304000-byte buffer

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 16581132288 bytes.)

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 16157507584 bytes.)

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 86114304000-byte buffer

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 16286482432 bytes.)

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 15862857728 bytes.)

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 11206656000-byte buffer

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 11206656000-byte buffer

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 12238979072 bytes.)

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 12091129856 bytes.)

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 12681478144 bytes.)

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 12460228608 bytes.)

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 12091129856 bytes.)

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 11206656000-byte buffer

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 11206656000-byte buffer

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 11206656000-byte buffer

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 86114304000-byte buffer

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 17466130432 bytes.)

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 17042505728 bytes.)

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 86114304000-byte buffer

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 17466130432 bytes.)

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 17042505728 bytes.)

[E] [defaultAllocator.cpp::allocate::31] Error Code 1: Cuda Runtime (out of memory)

[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:117] autotuning: User allocator error allocating 86114304000-byte buffer

[E] [virtualMemoryBuffer.cpp::resizePhysical::154] Error Code 2: OutOfMemory (Requested size was 16286482432 bytes.)

How should I fix this error?

Environment

docker:nvcr.io/nvidia/pytorch:24.07-py3

TensorRT Version: 10.6

NVIDIA GPU: rtx4090

NVIDIA Driver Version:NVIDIA-SMI 535.161.07

CUDA Version:12.2

CUDNN Version:

Operating System:

Python Version (if applicable): 3.10

Tensorflow Version (if applicable):

PyTorch Version (if applicable):2.4.0a0+3bcc3cddb5.nv24.7

Baremetal or Container (if so, version):

Steps To Reproduce

docker run --rm -it --gpus all -v $PWD:/workspace nvcr.io/nvidia/pytorch:24.07-py3 /bin/bash
python3 -m pip install --upgrade pip
pip install --pre tensorrt-cu12
export TRT_OSSPATH=/workspace
cd $TRT_OSSPATH/demo/Diffusion
pip3 install -r requirements.txt
python3 demo_img2vid.py --version svd-xt-1.1 --onnx-dir onnx-svd-xt-1-1 --engine-dir engine-svd-xt-1-1 --hf-token=$HF_TOKEN

@kolyh kolyh changed the title XXX failure of TensorRT X.Y when running XXX on GPU XXX Skipping tactic 0x0000000000000000 due to exception failure of TensorRT 10.6 when running demo_img2vid. py on GPU rtx4090 Nov 19, 2024
@kolyh kolyh changed the title Skipping tactic 0x0000000000000000 due to exception failure of TensorRT 10.6 when running demo_img2vid. py on GPU rtx4090 User allocator error allocating 86114304000-byte buffer failure of TensorRT 10.6 when running demo_img2vid. py on GPU rtx4090 Nov 19, 2024
@lix19937
Copy link

86114304000-byte means 80.2GB, overrange of rtx4090 gpu memory( 24GB ). You can try to assign --height and --width with a smaller value.

@kolyh
Copy link
Author

kolyh commented Nov 21, 2024

86114304000-byte means 80.2GB, overrange of rtx4090 gpu memory( 24GB ). You can try to assign --height and --width with a smaller value.

I made the same attempt on A100, using a resolution of 1280 * 1280.
But the same error occurred
Is 1280 * 1280 a large resolution?

@lix19937
Copy link

When you load engine, ou can watch nvidia-smi to see gpu mem state.

@poweiw
Copy link
Collaborator

poweiw commented Dec 2, 2024

Without knowing the size of your model it's hard to estimate how much vram you might need to use, but as @lix19937 said you can try to use a smaller frame size or also try --fp8 or --int8 for a smaller precision. cc @asfiyab-nvidia

@poweiw poweiw added triaged Issue has been triaged by maintainers Module:DemoDiffusion Issues regarding demoDiffusion labels Dec 2, 2024
@tppqt
Copy link

tppqt commented Dec 15, 2024

Without knowing the size of your model it's hard to estimate how much vram you might need to use, but as @lix19937 said you can try to use a smaller frame size or also try --fp8 or --int8 for a smaller precision. cc @asfiyab-nvidia

I've run into this problem too, it's a Tensorrt model for SVD-XT-1-1, over 2GB, its ontology is a small .onnx and then there's a data that's supposed to be an onnx, running the onnx to tensorrt code reports insufficient GPU allocation, and it's modeled as follows
https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt-1-1-tensorrt/tree/main/unet-temp.opt

@tppqt
Copy link

tppqt commented Dec 15, 2024

it's in demo->Diffusion->demo_img2vid.py
I run:
python3 demo_img2vid.py --version svd-xt-1.1 --onnx-dir onnx-svd-xt-1-1 --engine-dir engine-svd-xt-1-1 --input-image https://www.hdcarwallpapers.com/walls/2018_chevrolet_camaro_zl1_nascar_race_car_2-HD.jpg
and I got this:
[E] [defaultAllocator.cpp::allocate::19] Error code 1: cuda Runtime (out of memory)TE] Error code: 9: skipping tactic 0x0000000000000000 due to exception [tunablegraph.cpp:create:116] autotuning: user allocator error allocating 86114305024-byte buffer
[E] [virtualMemoryBuffer.cpp::resizePhysical::140] Error code 2: out of Memory (Requested size was 22942842880 bytes.)[E] [virtualMemoryBuffer.cpp::resizePhysical::140] Error code 2: out of Memory (Requested size was 23532142592 bytes.)[E] [defaultAllocator.cpp::allocate::19] Error code 1: cuda Runtime (out of memory)TE] Error code: 9: skipping tactic 0x0000000000000000 due to exception [tunablegraph.cpp:create:116] autotuning: User allocator error allocating 86114305024-byte buffer
[E][virtualMemoryBuffer.cpp::resizePhysical::140] Error code 2: 0utofMemory (Requested size was 22942842880 bytes.)

what can I do?

@praveenperfecto
Copy link

[E] [defaultAllocator.cpp::allocate::28] Error Code 1: Cuda Runtime (out of memory)
[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:123] autotuning: User allocator error allocating 86114304000-byte buffer
[E] [defaultAllocator.cpp::allocate::28] Error Code 1: Cuda Runtime (out of memory)
[E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [tunable_graph.cpp:create:123] autotuning: User allocator error allocating 86114304000-byte buffer

the issue persist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module:DemoDiffusion Issues regarding demoDiffusion triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

5 participants