-
Notifications
You must be signed in to change notification settings - Fork 769
[bug] how to solve compile sycl-toolchain code occur error: '/tmp/libsycl-fallback-imf-d878ec.cubin': Permission denied #7777
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
Comments
thanks @wangzy0327 for reporting this issue. We will look into this and get back to you shortly. |
I've tried recreating this and I've been unsuccessful. mkdir 7777
cd 7777
git clone https://github.com/intel/llvm llvm-project
cat << 'EOD' > Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.synced_folder "llvm-project", "/vagrant/llvm-project"
config.vm.provider "virtualbox" do |vb|
vb.memory = "16384"
vb.cpus = "8"
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -qy wget gnupg2 software-properties-common
wget -q -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - && apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
apt-get update -qy && apt-get install -qy \
wget \
git \
libncurses5-dev \
libncursesw5-dev \
vim \
build-essential \
ninja-build \
cmake \
python3-distutils \
linux-headers-`uname -r`
wget https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda_11.2.0_460.27.04_linux.run -q -O cuda.run
sh cuda.run --silent --toolkit && rm cuda.run
SHELL
end
EOD
cat << 'EOD' > example.cpp
#include <sycl/sycl.hpp>
#include <iostream>
#include <vector>
using namespace sycl;
int main(){
std::cout<<"hello sycl"<<std::endl;
const int N = 4;
const int MAGIC_NUM = 42;
std::vector<int> vec_num = {3,4,5,6,7,8,9};
std::cout<<vec_num[0]<<std::endl;
queue q;
auto dev = q.get_device();
std::cout<<"default queue select device info : "<<&dev<<std::endl;
std::cout<<"default queue select device vendor id : "<<dev.get_info<sycl::info::device::vendor_id>()<<std::endl;
std::cout<<"default queue select device vendor name : "<<dev.get_info<sycl::info::device::name>()<<std::endl;
auto devices = dev.get_devices();
for (auto &device : devices) {
std::cout << " queue get device: " << device.get_info<sycl::info::device::name>() << std::endl;
std::cout << " queue get device vendor id: " << device.get_info<sycl::info::device::vendor_id>()<< std::endl;
std::cout << " queue get device object address : " << &device << std::endl;
}
auto ctxt = q.get_context();
auto platforms = sycl::platform::get_platforms();
for (auto &platform : platforms) {
std::cout << "Platform name : " << platform.get_info<sycl::info::platform::name>()<< std::endl;
std::cout << "Platform profile : " << platform.get_info<sycl::info::platform::profile>()<<std::endl;
std::cout << "Platform version : " << platform.get_info<sycl::info::platform::version>()<<std::endl;
std::cout << "Platform vendor : " << platform.get_info<sycl::info::platform::vendor>()<<std::endl;
std::cout << "Platform object address : " << &platform<< std::endl;
auto devices = platform.get_devices();
for (auto &device : devices) {
std::cout << " Device: " << device.get_info<sycl::info::device::name>() << std::endl;
std::cout << " Device vendor id: " << device.get_info<sycl::info::device::vendor_id>()<< std::endl;
std::cout << " Device object address : " << &device << std::endl;
}
}
std::vector<kernel_id> builtinKernelIds =
dev.get_info<info::device::built_in_kernel_ids>();
std::cout<<"built in kernel size : "<<builtinKernelIds.size()<<std::endl;
auto myBundle = get_kernel_bundle<bundle_state::executable>(ctxt);
return 0;
}
EOD
cat <<'EOD' > CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
set(DPCPP_HOME "/vagrant/llvm-project/")
set(CMAKE_C_COMPILER "${DPCPP_HOME}/build/bin/clang")
set(CMAKE_CXX_COMPILER "${DPCPP_HOME}/build/bin/clang++")
set(CMAKE_CXX_STANDARD 17)
project(hello-sycl)
set(DPCPP_SYCL_HOME "${DPCPP_HOME}/build")
include_directories("${DPCPP_SYCL_HOME}/include/sycl")
include_directories("${DPCPP_SYCL_HOME}/include")
message(STATUS "dpcpp_home : ${DPCPP_HOME}")
message(STATUS "dpcpp_cuda_sycl_home : ${DPCPP_SYCL_HOME}")
message(STATUS "find library path : ${DPCPP_SYCL_HOME}/lib")
set(CMAKE_BUILD_RPATH "${DPCPP_SYCL_HOME}/lib;${CMAKE_BUILD_RPATH}")
message(STATUS "cmake build rpath : ${CMAKE_BUILD_RPATH}")
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_FLAGS "-fsycl -fsycl-targets=nvptx64-nvidia-cuda")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb -std=c++17 -Wno-sycl-target -Wno-linker-warnings")
# set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall -std=c++17")
link_directories("${DPCPP_SYCL_HOME}/lib")
aux_source_directory(. DIR_SRCS)
add_executable(hello-sycl ${DIR_SRCS})
target_include_directories(hello-sycl PRIVATE "${DPCPP_SYCL_HOME}/include/sycl")
target_include_directories(hello-sycl PRIVATE "${DPCPP_SYCL_HOME}/include")
target_link_libraries(hello-sycl PRIVATE sycl)
EOD
cat << 'EOD' > recreate
#!/bin/bash
cd /vagrant/llvm-project
mkdir -p /vagrant/llvm-project/build
cd /vagrant/llvm-project/build
python3 ../buildbot/configure.py --cuda --cmake-opt=-DLLVM_USE_LINKER=gold --cmake-opt=-DLLVM_PARALLEL_LINK_JOBS=2 --cmake-opt=-DCUDA_CUDA_LIBRARY=/usr/local/cuda-11.2/targets/x86_64-linux/lib/stubs/libcuda.so
ninja check-sycl-deploy -k 0 # ignore some python command problems in the lit tests on 18.04
cd /vagrant
for _ in {1..100} ; do
rm -rf build
mkdir build
cmake -B build
if ! cmake --build build ; then echo FAILED ; break ; fi
done
EOD
vagrant up
vagrant ssh -c 'bash /vagrant/recreate' I had no failures to link the example with the 100 tries looped in the last fragment listed. |
@ldrumm I also met the problem in my scenary as following display. It quite exists the problem but is difficult to reproduce. |
Could you please paste plain text rather than screenshots? It's hard to extract information from a screenshot |
@ldrumm @Pennycook Can you try to reproduce the problem in my same environment? OS System environment
OS kernel version
cuda version
Sycl version: 2022-12-release reproduce example: CMakeLists.txt
complex.cc
test.sh
I get the result which display
|
The only difference is my kernel version is
I reran using the binary release you posted (rather than building from source as before) and still can't recreate the bug
However, that's still not a permissions issue. I don't think there's anything I can do to help further, but ask the following, in order of simplicity
Without being able to reproduce locally, I'm unable to help. I suggest you follow the above steps to determine where the issue lies. |
There is enough amount of space avaliable in |
After I made two changes, the '/tmp/libsycl-fallback-imf-d878ec.cubin':Permission denied was tested many times and never appeared.
I am not sure which change lead to the result. Can you compare your previous environment with it ? |
Describe the bug
sometimes occur the following error. how to solve it ?
clang-16: warning: linked binaries do not contain expected 'nvptx64-nvidia-cuda' target; found targets: 'nvptx64-nvidia-cuda-sm_50' [-Wsycl-target]
/home/wzy/sycl_workspace/build-cuda-2022-09-debug/bin/clang-offload-bundler: error: '/tmp/libsycl-fallback-imf-d878ec.cubin': Permission denied
clang-16: error: clang-offload-bundler command failed with exit code 1 (use -v to see invocation)
CMakeFiles/hello-sycl.dir/build.make:102: recipe for target 'hello-sycl' failed
gmake[2]: *** [hello-sycl] Error 1
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/hello-sycl.dir/all' failed
gmake[1]: *** [CMakeFiles/hello-sycl.dir/all] Error 2
To Reproduce
any sycl-example code occurs the error somtimes.
There provides a sycl example that occurs the following error when the code compile(cmake -B build && cmake --build build).
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_C_COMPILER "/home/wzy/sycl_workspace/build-cuda-2022-09-debug/bin/clang")
set(CMAKE_CXX_COMPILER "/home/wzy/sycl_workspace/build-cuda-2022-09-debug/bin/clang++")
set(CMAKE_CXX_STANDARD 17)
project(hello-sycl)
set(DPCPP_HOME "/home/wzy/sycl_workspace")
set(DPCPP_SYCL_HOME "${DPCPP_HOME}/build-cuda-2022-09-debug")
include_directories("${DPCPP_SYCL_HOME}/include/sycl")
include_directories("${DPCPP_SYCL_HOME}/include")
message(STATUS "dpcpp_home : ${DPCPP_HOME}")
message(STATUS "dpcpp_cuda_sycl_home : ${DPCPP_SYCL_HOME}")
message(STATUS "find library path : ${DPCPP_SYCL_HOME}/lib")
set(CMAKE_BUILD_RPATH "${DPCPP_SYCL_HOME}/lib;${CMAKE_BUILD_RPATH}")
message(STATUS "cmake build rpath : ${CMAKE_BUILD_RPATH}")
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_FLAGS "-fsycl -fsycl-targets=nvptx64-nvidia-cuda")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb -std=c++17 -Wno-sycl-target -Wno-linker-warnings")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall -std=c++17")
link_directories("${DPCPP_SYCL_HOME}/lib")
aux_source_directory(. DIR_SRCS)
add_executable(hello-sycl ${DIR_SRCS})
target_include_directories(hello-sycl PRIVATE "${DPCPP_SYCL_HOME}/include/sycl")
target_include_directories(hello-sycl PRIVATE "${DPCPP_SYCL_HOME}/include")
target_link_libraries(hello-sycl PRIVATE sycl)
my-example
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: