Skip to content

This repo holds the extended examples for rules_cuda.

Notifications You must be signed in to change notification settings

cloudhan/rules_cuda_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rules_cuda examples

rules_cuda is a starlark implementation of bazel rules for CUDA. This repo holds the extended examples for it.

Get Started

git clone --recursive https://github.com/cloudhan/rules_cuda_examples.git

See the subfolders

Note: It is unconventional to use submodule a bazel project. It is purely for simplicity to avoid implementing repository rules. So notice the --recursive!

Known issue

Sometimes the following error occurs:

cc1plus: fatal error: /tmp/tmpxft_00000002_00000019-2.cpp: No such file or directory

The problem is caused by nvcc use PID to determine temporary file name, and with --spawn_strategy linux-sandbox which is the default strategy on Linux, the PIDs nvcc sees are all very small numbers, say 2~4 due to sanboxing. linux-sandbox is not hermetic because it mount root into the sandbox, thus, /tmp is shared between sandboxes, which is causing name conflict under high parallelism. Similar problem has been reported at nvidia forums.

To avoid it:

  • Use --spawn_strategy local should eliminate the case because it will let nvcc sees true PIDs.
  • Use --experimental_use_hermetic_linux_sandbox should eliminate the case because it will avoid the sharing of /tmp.
  • Add -objtemp option to the command should reduce the case from happening.

About

This repo holds the extended examples for rules_cuda.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published