You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with one addition at line 42: println!("{}", device.is_cuda());
and i when start i'am getting:
**false** (Is cuda avaliable: false)
AND Most intresing thing!
When i build it by C++ by this instruction
https://pytorch.org/cppdocs/installing.html
my code like:
#include<torch/torch.h>
#include<iostream>intmain() {
if (torch::cuda::is_available()) {
std::cout << "CUDA is available! Running on GPU." << std::endl;
} else {
std::cout << "CUDA is not available. Running on CPU." << std::endl;
}
return0;
}
my CMakeLists.txt like
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project(example-app)
find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${TORCH_CXX_FLAGS}")
add_executable(example-app main.cpp)
target_link_libraries(example-app "${TORCH_LIBRARIES}")
set_property(TARGET example-app PROPERTY CXX_STANDARD 17)
# The following code block is suggested to be used on Windows.# According to https://github.com/pytorch/pytorch/issues/25457,# the DLLs need to be copied to avoid memory errors.if (MSVC)
file(GLOB TORCH_DLLS "${TORCH_INSTALL_PREFIX}/lib/*.dll")
add_custom_command(TARGET example-app
POST_BUILDCOMMAND${CMAKE_COMMAND} -E copy_if_different
${TORCH_DLLS}
$<TARGET_FILE_DIR:example-app>)
endif (MSVC)
it's compiles and i get:
CUDA is available! Running on GPU.
Please help me
Edit:
I'am compared Rust compiled app with C++ compiled app by Dependency Walker
In Rust app no TORCH_CUDA.dll dep
C++ app deps:
Rust app deps:
The text was updated successfully, but these errors were encountered:
Hello
I have problem a long time can't fix it
PyTorch 2.5.0 C++ Libtorch version cu118
dowloaded from here:
all variables set for user and as system:
(path to libtorch) PATH:
i'am trying to use this example https://github.com/LaurentMazare/tch-rs/tree/main/examples/char-rnn
.cargo/config.toml
with one addition at line 42:
println!("{}", device.is_cuda());
and i when start i'am getting:
AND Most intresing thing!
When i build it by C++ by this instruction
my code like:
my
CMakeLists.txt
likeit's compiles and i get:
Please help me
Edit:
I'am compared Rust compiled app with C++ compiled app by
Dependency Walker
In Rust app no TORCH_CUDA.dll dep
C++ app deps:
Rust app deps:
The text was updated successfully, but these errors were encountered: