[GH-ISSUE #642] TORCH_USE_CUDA_DSA #378

Closed
opened 2026-10-20 09:58:41 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @ask0 on GitHub (Jun 27, 2023).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/642

Getting this error while using Vocals/Accompaniment Separation & Reverberation Removal


jahgik56wci.mp3.reformatted.wav->Traceback (most recent call last):
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer-web.py", line 371, in uvr
    pre_fun._path_audio_(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer_uvr5.py", line 105, in _path_audio_
    pred, X_mag, X_phase = inference(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\utils.py", line 78, in inference
    pred = _execute(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\utils.py", line 47, in _execute
    X_mag_window = X_mag_window.to(device)
RuntimeError: CUDA error: an illegal memory access was encountered
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

GPU 1060 6GB

Originally created by @ask0 on GitHub (Jun 27, 2023). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/642 Getting this error while using Vocals/Accompaniment Separation & Reverberation Removal ``` jahgik56wci.mp3.reformatted.wav->Traceback (most recent call last): File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer-web.py", line 371, in uvr pre_fun._path_audio_( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer_uvr5.py", line 105, in _path_audio_ pred, X_mag, X_phase = inference( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\utils.py", line 78, in inference pred = _execute( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\utils.py", line 47, in _execute X_mag_window = X_mag_window.to(device) RuntimeError: CUDA error: an illegal memory access was encountered Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. ``` GPU 1060 6GB
Author
Owner

@TripleKiller666 commented on GitHub (Jun 28, 2023):

Proper CUDA Version installed?
If not, or not sure then try:
pip install -upgrade torch torchvision torchaudio --index-url https:/download.pytorch.org/whl/cu117

replace the "cu117" (CUDA 11.7) at the end with the CUDA version your Card supports

<!-- gh-comment-id:1611586984 --> @TripleKiller666 commented on GitHub (Jun 28, 2023): Proper CUDA Version installed? If not, or not sure then try: pip install -upgrade torch torchvision torchaudio --index-url https:/download.pytorch.org/whl/cu117 replace the "cu117" (CUDA 11.7) at the end with the CUDA version your Card supports
Author
Owner

@ask0 commented on GitHub (Jun 28, 2023):

Proper CUDA Version installed? If not, or not sure then try: pip install -upgrade torch torchvision torchaudio --index-url https:/download.pytorch.org/whl/cu117

replace the "cu117" (CUDA 11.7) at the end with the CUDA version your Card supports


C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618>runtime\python.exe infer-web.py --pycmd runtime\python.exe --port 7897
16系/10系显卡和P40强制单精度
Use Language: en_US
Running on local URL:  http://0.0.0.0:7897
 25%|████████████████████▍                                                           | 106/416 [00:45<02:12,  2.34it/s]
Traceback (most recent call last):
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer-web.py", line 355, in uvr
    pre_fun._path_audio_(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer_uvr5.py", line 105, in _path_audio_
    pred, X_mag, X_phase = inference(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\utils.py", line 78, in inference
    pred = _execute(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\utils.py", line 49, in _execute
    pred = model.predict(X_mag_window, aggressiveness)
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\lib_v5\nets_61968KB.py", line 116, in predict
    h = self.forward(x_mag, aggressiveness)
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\lib_v5\nets_61968KB.py", line 79, in forward
    h = self.stg3_full_band_net(self.stg3_bridge(h))
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\lib_v5\nets_61968KB.py", line 34, in __call__
    h = self.dec1(h, e1)
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\lib_v5\layers_123821KB.py", line 77, in __call__
    x = torch.cat([x, skip], dim=1)
RuntimeError: CUDA error: an illegal memory access was encountered
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

ffmpeg version n4.3.2-160-gfbb9368226 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 9.3-win32 (GCC) 20200320
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --disable-avisynth --enable-libdav1d --disable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --disable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --disable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --disable-libvidstab --disable-libx264 --disable-libx265 --disable-libxavs2 --disable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
Input #0, mp3, from 'C:\Users\ask\AppData\Local\Temp\jahiloyerul.mp3':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    encoder         : Lavf58.19.102
  Duration: 00:19:17.38, start: 0.025057, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.34
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\TEMP/jahiloyerul.mp3.reformatted.wav':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    ISFT            : Lavf58.45.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
    Metadata:
      encoder         : Lavc58.91.100 pcm_s16le
[mp3float @ 0000015554acd480] Header missing5.1kbits/s speed= 666x
Error while decoding stream #0:0: Invalid data found when processing input
size=  199368kB time=00:19:17.35 bitrate=1411.2kbits/s speed= 635x
video:0kB audio:199368kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000038%
  0%|                                                                                          | 0/416 [00:00<?, ?it/s]
clean_empty_cache
Traceback (most recent call last):
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\gradio\routes.py", line 321, in run_predict
    output = await app.blocks.process_api(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\gradio\blocks.py", line 1006, in process_api
    result = await self.call_function(fn_index, inputs, iterator, request)
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\gradio\blocks.py", line 859, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\gradio\utils.py", line 408, in async_iteration
    return next(iterator)
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer-web.py", line 396, in uvr
    torch.cuda.empty_cache()
  File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\torch\cuda\memory.py", line 133, in empty_cache
    torch._C._cuda_emptyCache()
RuntimeError: CUDA error: an illegal memory access was encountered
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

<!-- gh-comment-id:1611770266 --> @ask0 commented on GitHub (Jun 28, 2023): > Proper CUDA Version installed? If not, or not sure then try: pip install -upgrade torch torchvision torchaudio --index-url https:/download.pytorch.org/whl/cu117 > > replace the "cu117" (CUDA 11.7) at the end with the CUDA version your Card supports ``` C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618>runtime\python.exe infer-web.py --pycmd runtime\python.exe --port 7897 16系/10系显卡和P40强制单精度 Use Language: en_US Running on local URL: http://0.0.0.0:7897 25%|████████████████████▍ | 106/416 [00:45<02:12, 2.34it/s] Traceback (most recent call last): File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer-web.py", line 355, in uvr pre_fun._path_audio_( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer_uvr5.py", line 105, in _path_audio_ pred, X_mag, X_phase = inference( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\utils.py", line 78, in inference pred = _execute( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\utils.py", line 49, in _execute pred = model.predict(X_mag_window, aggressiveness) File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\lib_v5\nets_61968KB.py", line 116, in predict h = self.forward(x_mag, aggressiveness) File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\lib_v5\nets_61968KB.py", line 79, in forward h = self.stg3_full_band_net(self.stg3_bridge(h)) File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\lib_v5\nets_61968KB.py", line 34, in __call__ h = self.dec1(h, e1) File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\uvr5_pack\lib_v5\layers_123821KB.py", line 77, in __call__ x = torch.cat([x, skip], dim=1) RuntimeError: CUDA error: an illegal memory access was encountered Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. ffmpeg version n4.3.2-160-gfbb9368226 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 9.3-win32 (GCC) 20200320 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --disable-avisynth --enable-libdav1d --disable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --disable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --disable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --disable-libvidstab --disable-libx264 --disable-libx265 --disable-libxavs2 --disable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 Input #0, mp3, from 'C:\Users\ask\AppData\Local\Temp\jahiloyerul.mp3': Metadata: major_brand : M4A minor_version : 512 compatible_brands: isomiso2 encoder : Lavf58.19.102 Duration: 00:19:17.38, start: 0.025057, bitrate: 128 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc58.34 Stream mapping: Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, wav, to 'C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\TEMP/jahiloyerul.mp3.reformatted.wav': Metadata: major_brand : M4A minor_version : 512 compatible_brands: isomiso2 ISFT : Lavf58.45.100 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s Metadata: encoder : Lavc58.91.100 pcm_s16le [mp3float @ 0000015554acd480] Header missing5.1kbits/s speed= 666x Error while decoding stream #0:0: Invalid data found when processing input size= 199368kB time=00:19:17.35 bitrate=1411.2kbits/s speed= 635x video:0kB audio:199368kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000038% 0%| | 0/416 [00:00<?, ?it/s] clean_empty_cache Traceback (most recent call last): File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\gradio\routes.py", line 321, in run_predict output = await app.blocks.process_api( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\gradio\blocks.py", line 1006, in process_api result = await self.call_function(fn_index, inputs, iterator, request) File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\gradio\blocks.py", line 859, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\gradio\utils.py", line 408, in async_iteration return next(iterator) File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\infer-web.py", line 396, in uvr torch.cuda.empty_cache() File "C:\Users\ask\Desktop\RVC-beta\RVC-beta-v2-0618\runtime\lib\site-packages\torch\cuda\memory.py", line 133, in empty_cache torch._C._cuda_emptyCache() RuntimeError: CUDA error: an illegal memory access was encountered Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. ```
Author
Owner

@ask0 commented on GitHub (Jun 28, 2023):

this fixed;

pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu117
<!-- gh-comment-id:1611810882 --> @ask0 commented on GitHub (Jun 28, 2023): this fixed; ``` pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu117 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion-WebUI#378
No description provided.